return error->error_code;
}
+const char*
+mono_error_get_exception_name (MonoError *oerror)
+{
+ MonoErrorInternal *error = (MonoErrorInternal*)oerror;
+
+ if (error->error_code == MONO_ERROR_NONE)
+ return NULL;
+
+ return error->exception_name;
+}
+
/*Return a pointer to the internal error message, might be NULL.
Caller should not release it.*/
const char*
va_end (args);
}
+/**
+ * mono_error_set_file_not_found:
+ *
+ * System.IO.FileNotFoundException
+ */
+void
+mono_error_set_file_not_found (MonoError *oerror, const char *msg_format, ...)
+{
+ va_list args;
+ va_start (args, msg_format);
+ mono_error_set_generic_errorv (oerror, "System.IO", "FileNotFoundException", msg_format, args);
+ va_end (args);
+}
+
void
mono_error_set_invalid_program (MonoError *oerror, const char *msg_format, ...)
{
set_error_message ();
}
+/**
+ * mono_error_set_invalid_cast:
+ *
+ * System.InvalidCastException
+ */
+void
+mono_error_set_invalid_cast (MonoError *oerror)
+{
+ mono_error_set_generic_error (oerror, "System", "InvalidCastException", "");
+}
+
void
mono_error_set_exception_instance (MonoError *oerror, MonoException *exc)
{