MonoException * mono_get_exception_runtime_wrapped (MonoObject *wrapped_exception) { MonoRuntimeWrappedException *ex = (MonoRuntimeWrappedException*) mono_exception_from_name (mono_get_corlib (), "System.Runtime.CompilerServices", "RuntimeWrappedException"); MONO_OBJECT_SETREF (ex, wrapped_exception, wrapped_exception); return (MonoException*)ex; }
/** * mono_exception_from_name_msg: * @image: the Mono image where to look for the class * @name_space: the namespace for the class * @name: class name * @msg: the message to embed inside the exception * * Creates an exception and initializes its message field. * * Returns: the initialized exception instance. */ MonoException * mono_exception_from_name_msg (MonoImage *image, const char *name_space, const char *name, const char *msg) { MonoException *ex; ex = mono_exception_from_name (image, name_space, name); if (msg) MONO_OBJECT_SETREF (ex, message, mono_string_new (mono_object_get_domain ((MonoObject*)ex), msg)); return ex; }
/** * mono_get_exception_argument_out_of_range: * @arg: the name of the out of range argument. * * Returns: a new instance of the `System.ArgumentOutOfRangeException` */ MonoException * mono_get_exception_argument_out_of_range (const char *arg) { MonoException *ex; ex = mono_exception_from_name ( mono_get_corlib (), "System", "ArgumentOutOfRangeException"); if (arg) { MonoArgumentException *argex = (MonoArgumentException *)ex; MONO_OBJECT_SETREF (argex, param_name, mono_string_new (mono_object_get_domain ((MonoObject*)ex), arg)); } return ex; }
/** * mono_get_exception_stack_overflow: * * Returns: a new instance of the `System.StackOverflowException` */ MonoException * mono_get_exception_stack_overflow (void) { return mono_exception_from_name (mono_get_corlib (), "System", "StackOverflowException"); }
/** * mono_get_exception_appdomain_unloaded * * Returns: a new instance of the `System.AppDomainUnloadedException` */ MonoException * mono_get_exception_appdomain_unloaded (void) { return mono_exception_from_name (mono_get_corlib (), "System", "AppDomainUnloadedException"); }
/** * mono_get_exception_array_type_mismatch: * * Returns: a new instance of the `System.ArrayTypeMismatchException` */ MonoException * mono_get_exception_array_type_mismatch () { return mono_exception_from_name (mono_get_corlib (), "System", "ArrayTypeMismatchException"); }
/** * mono_get_exception_index_out_of_range: * * Returns: a new instance of the `System.IndexOutOfRangeException` */ MonoException * mono_get_exception_index_out_of_range () { return mono_exception_from_name (mono_get_corlib (), "System", "IndexOutOfRangeException"); }
/** * mono_get_exception_invalid_cast: * * Returns: a new instance of the `System.InvalidCastException` */ MonoException * mono_get_exception_invalid_cast () { return mono_exception_from_name (mono_get_corlib (), "System", "InvalidCastException"); }
/** * mono_get_exception_overflow: * * Returns: a new instance of the `System.OverflowException` */ MonoException * mono_get_exception_overflow () { return mono_exception_from_name (mono_get_corlib (), "System", "OverflowException"); }
/** * mono_get_exception_arithmetic: * * Returns: a new instance of the `System.ArithmeticException` */ MonoException * mono_get_exception_arithmetic () { return mono_exception_from_name (mono_get_corlib (), "System", "ArithmeticException"); }
/** * mono_get_exception_thread_interrupted: * * Returns: a new instance of the `System.Threading.ThreadInterruptedException` */ MonoException * mono_get_exception_thread_interrupted () { return mono_exception_from_name (mono_get_corlib (), "System.Threading", "ThreadInterruptedException"); }
/** * mono_get_exception_thread_abort: * * Returns: a new instance of the `System.Threading.ThreadAbortException` */ MonoException * mono_get_exception_thread_abort () { return mono_exception_from_name (mono_get_corlib (), "System.Threading", "ThreadAbortException"); }
/** * mono_get_exception_security: * * Returns: a new instance of the `System.Security.SecurityException` */ MonoException * mono_get_exception_security () { return mono_exception_from_name (mono_get_corlib (), "System.Security", "SecurityException"); }
/** * mono_get_exception_divide_by_zero: * * Returns: a new instance of the `System.DivideByZeroException` */ MonoException * mono_get_exception_divide_by_zero () { return mono_exception_from_name (mono_get_corlib (), "System", "DivideByZeroException"); }
/** * mono_get_exception_out_of_memory: * * Returns: a new instance of the `System.OutOfMemoryException` */ MonoException * mono_get_exception_out_of_memory (void) { return mono_exception_from_name (mono_get_corlib (), "System", "OutOfMemoryException"); }
/** * mono_get_exception_null_reference: * * Returns: a new instance of the `System.NullReferenceException` */ MonoException * mono_get_exception_null_reference () { return mono_exception_from_name (mono_get_corlib (), "System", "NullReferenceException"); }
/** * mono_get_exception_method_access: * * Returns: a new instance of the `System.MethodAccessException` */ MonoException * mono_get_exception_method_access (void) { return mono_exception_from_name (mono_get_corlib (), "System", "MethodAccessException"); }
MonoExceptionHandle mono_get_exception_out_of_memory_handle (void) { return MONO_HANDLE_NEW (MonoException, mono_exception_from_name (mono_get_corlib (), "System", "OutOfMemoryException")); }