Merge pull request #3120 from esdrubal/syscall_details
[mono.git] / mono / metadata / exception.c
index 76f70a3dcfc7e0a0a0c9994186aad2998b18a35e..2aff26dfd53788fe5080ef51e97cbaf0b9975045 100644 (file)
@@ -245,16 +245,31 @@ mono_exception_from_token_two_strings (MonoImage *image, guint32 token,
                                                                           MonoString *a1, MonoString *a2)
 {
        MonoError error;
-       MonoClass *klass;
        MonoException *ret;
+       ret = mono_exception_from_token_two_strings_checked (image, token, a1, a2, &error);
+       mono_error_cleanup (&error);
+       return ret;
+}
 
-       klass = mono_class_get_checked (image, token, &error);
-       mono_error_assert_ok (&error); /* FIXME handle the error. */
+/**
+ * mono_exception_from_token_two_strings_checked:
+ *
+ *   Same as mono_exception_from_name_two_strings, but lookup the exception class using
+ * IMAGE and TOKEN.
+ */
+MonoException *
+mono_exception_from_token_two_strings_checked (MonoImage *image, guint32 token,
+                                              MonoString *a1, MonoString *a2,
+                                              MonoError *error)
+{
+       MonoClass *klass;
 
-       ret = create_exception_two_strings (klass, a1, a2, &error);
-       mono_error_raise_exception (&error); /* FIXME don't raise here */
+       mono_error_init (error);
 
-       return ret;
+       klass = mono_class_get_checked (image, token, error);
+       mono_error_assert_ok (error); /* FIXME handle the error. */
+
+       return create_exception_two_strings (klass, a1, a2, error);
 }
 
 /**