2 * exception.c: Exception handling
5 * Paolo Molaro (lupus@ximian.com)
6 * Dietmar Maurer (dietmar@ximian.com)
7 * Dick Porter (dick@ximian.com)
9 * (C) 2001 Ximian, Inc.
12 #include <mono/metadata/exception.h>
13 #include <mono/metadata/class.h>
16 mono_exception_from_name (MonoImage *image, const char *name_space,
22 klass = mono_class_from_name (image, name_space, name);
24 o = mono_object_new (klass);
27 mono_runtime_object_init (o);
33 get_exception_divide_by_zero ()
35 static MonoObject *ex = NULL;
38 ex = mono_exception_from_name (mono_defaults.corlib, "System",
39 "DivideByZeroException");
44 get_exception_security ()
46 static MonoObject *ex = NULL;
49 ex = mono_exception_from_name (mono_defaults.corlib, "System",
55 get_exception_arithmetic ()
57 static MonoObject *ex = NULL;
60 ex = mono_exception_from_name (mono_defaults.corlib, "System",
61 "ArithmeticException");
66 get_exception_overflow ()
68 static MonoObject *ex = NULL;
71 ex = mono_exception_from_name (mono_defaults.corlib, "System",
77 get_exception_null_reference ()
79 static MonoObject *ex = NULL;
82 ex = mono_exception_from_name (mono_defaults.corlib, "System",
83 "NullReferenceException");
88 get_exception_execution_engine ()
90 static MonoObject *ex = NULL;
93 ex = mono_exception_from_name (mono_defaults.corlib, "System",
94 "ExecutionEngineException");
99 get_exception_invalid_cast ()
101 static MonoObject *ex = NULL;
104 ex = mono_exception_from_name (mono_defaults.corlib, "System",
105 "InvalidCastException");
110 get_exception_index_out_of_range ()
112 static MonoObject *ex = NULL;
115 ex = mono_exception_from_name (mono_defaults.corlib, "System",
116 "IndexOutOfRangeException");
121 get_exception_array_type_mismatch ()
123 static MonoObject *ex = NULL;
126 ex = mono_exception_from_name (mono_defaults.corlib, "System",
127 "ArrayTypeMismatchException");
132 get_exception_missing_method ()
134 static MonoObject *ex = NULL;
137 ex = mono_exception_from_name (mono_defaults.corlib, "System",
138 "MissingMethodException");