Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Runtime] Provide better diagnostics if we fail to invoke a method in CoreCLR. #15043

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/ObjCRuntime/Runtime.CoreCLR.cs
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,8 @@ static object InvokeMethod (MethodBase method, object instance, IntPtr native_pa
var ex = tie.InnerException ?? tie;
// This will re-throw the original exception and preserve the stacktrace.
ExceptionDispatchInfo.Capture (ex).Throw ();
} catch (Exception e) {
throw ErrorHelper.CreateError (8042, e, Errors.MX8042 /* An exception occurred while trying to invoke the function {0}: {1}. */, GetMethodFullName (method), e.Message);
}

// Copy any byref parameters back out again
Expand Down
9 changes: 9 additions & 0 deletions tools/mtouch/Errors.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions tools/mtouch/Errors.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2164,4 +2164,11 @@
<value>Unable to create an instance of the type {0}.</value>
</data>

<data name="MX8042" xml:space="preserve">
<value>An exception occurred while trying to invoke the function {0}: {1}.</value>
<comment>
0: name of function
1: exception info
</comment>
</data>
</root>