Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / utils / mono-error.c
index 2186c59a78ee8768d4687e75618ee1ea3ee0851b..27f2b62fb248ff784d2f6dbc9b350f98a7613d07 100644 (file)
@@ -176,6 +176,17 @@ mono_error_get_error_code (MonoError *error)
        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*
@@ -459,6 +470,20 @@ mono_error_set_invalid_operation (MonoError *oerror, const char *msg_format, ...
        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, ...)
 {