-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Java.Interop] JavaException.InnerException should elide Proxies.
Fixes: #1 JavaProxyThrowable is an internal type, and as such it shouldn't "leak" if at all possible, e.g. if someone creates a java.lang.Throwable in which the `cause` is a managed exception type such as InvalidOperationException. Previously, Exception.InnerException would have been the JavaProxyThrowable, as JavaException._GetCause() would lookup a JavaException instance. Returning a JavaProxyThrowable is ~useless; it's not a public API, and thus nothing useful can be done with it (short of resorting to Reflection). Fix JavaException._GetCause() so that it instead uses JavaVM.GetExceptionForThrowable(), which automatically "unwraps" JavaProxyThrowable instances to return the wrapped Exception.
- Loading branch information
Showing
2 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters