[attach] Don't raise in mono_attach_load_agent
authorAleksey Kliger <aleksey@xamarin.com>
Thu, 31 Mar 2016 21:00:34 +0000 (17:00 -0400)
committerAleksey Kliger <aleksey@xamarin.com>
Tue, 19 Apr 2016 22:07:21 +0000 (18:07 -0400)
mono/metadata/attach.c

index 6b65259b962b437f20e121671fb189b8486219c3..301492e8e5aea29adc140c77aa9fe0b66077ced5 100644 (file)
@@ -309,11 +309,16 @@ mono_attach_load_agent (MonoDomain *domain, char *agent, char *args, MonoObject
                main_args = (MonoArray*)mono_array_new (domain, mono_defaults.string_class, 0);
        }
 
-       g_free (agent);
-
        pa [0] = main_args;
        mono_runtime_try_invoke (method, NULL, pa, exc, &error);
-       mono_error_raise_exception (&error); /* FIXME don't raise here */
+       if (!is_ok (&error)) {
+               g_print ("The entry point method of assembly '%s' could not be executed due to %s\n", agent, mono_error_get_message (&error));
+               mono_error_cleanup (&error);
+               g_free (agent);
+               return 1;
+       }
+
+       g_free (agent);
 
        return 0;
 }