/* need to report exceptions ? */
if (throwOnError && mono_class_has_failure (klass)) {
/* report SecurityException (or others) that occured when loading the assembly */
- MonoException *exc = mono_class_get_exception_for_failure (klass);
- mono_set_pending_exception (exc);
+ mono_error_set_for_class_failure (&error, klass);
+ mono_error_set_pending_exception (&error);
return NULL;
}
}
check_for_invalid_type (MonoClass *klass, MonoError *error)
{
char *name;
- MonoString *str;
mono_error_init (error);
return;
name = mono_type_get_full_name (klass);
- str = mono_string_new (mono_domain_get (), name);
- g_free (name);
- mono_error_set_exception_instance (error, mono_get_exception_type_load (str, NULL));
-
+ mono_error_set_type_load_name (error, name, g_strdup (""), "");
}
ICALL_EXPORT MonoReflectionType *
ves_icall_RuntimeType_make_array_type (MonoReflectionType *type, int rank)
klass = mono_class_from_mono_type (type->type);
check_for_invalid_type (klass, &error);
- mono_error_set_pending_exception (&error);
+ if (mono_error_set_pending_exception (&error))
+ return NULL;
if (rank == 0) //single dimentional array
aklass = mono_array_class_get (klass, 1);