revert previous commit
[moon.git] / src / error.h
blob519c34cfdeb9a808f8becfd95d93b8e1962df39c
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3 * error.h: ErrorEventArgs and its subclasses
5 * Contact:
6 * Moonlight List (moonlight-list@lists.ximian.com)
8 * Copyright 2007 Novell, Inc. (http://www.novell.com)
10 * See the LICENSE file included with the distribution for details.
14 #ifndef __MOON_ERROR_H__
15 #define __MOON_ERROR_H__
17 class ErrorEventArgs;
20 #include "enums.h"
22 class ParserErrorEventArgs;
24 class MoonError {
25 public:
26 enum ExceptionType {
27 NO_ERROR = 0,
28 EXCEPTION = 1,
29 ARGUMENT = 2,
30 ARGUMENT_NULL = 3,
31 ARGUMENT_OUT_OF_RANGE = 4,
32 INVALID_OPERATION = 5,
33 XAML_PARSE_EXCEPTION = 6,
34 UNAUTHORIZED_ACCESS = 7,
35 EXECUTION_ENGINE_EXCEPTION = 8,
36 GCHANDLE_EXCEPTION = 9
39 // non-zero if an error occurred.
40 ExceptionType number;
42 // the silverlight error code
43 int code;
45 // Used for xaml parsing exceptions
46 int char_position;
47 int line_number;
49 char *message;
51 // managed code has thrown an exception, we store a gchandle
52 // to the exception here.
53 void* gchandle_ptr;
55 MoonError ();
56 MoonError (ExceptionType type, int code, const char *message);
57 ~MoonError ();
59 MoonError (const MoonError &e);
60 MoonError& operator= (const MoonError& other);
62 void Clear ();
64 static void FillIn (MoonError *error, ExceptionType type, int code, const char *message);
65 static void FillIn (MoonError *error, ExceptionType type, const char *message);
66 static void FillIn (MoonError *error, ParserErrorEventArgs *error_args);
69 #endif /* __MOON_ERROR_H__ */