-
Notifications
You must be signed in to change notification settings - Fork 526
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
Throwing FooException makes AppDomain throw JavaProxyThrowable instead of FooException #1144
Comments
The problem is that we don't "unwrap" exceptions when raising the var args = new UnhandledExceptionEventArgs (ex, isTerminating: true);
AppDomain_DoUnhandledException (AppDomain.CurrentDomain, args);
|
Fixes dotnet#1144 User code cannot easily unwrap the inner exception itself unless it uses reflection to read the `JavaProxyThrowable.InnerException` property which is unacceptable. Add code to unwrap the exception before calling the AppDomain unhandled exception handler.
) Fixes: #1144 User code cannot easily unwrap the inner exception itself unless it uses reflection to read the `JavaProxyThrowable.InnerException` property which is unacceptable. Add code to unwrap the exception before calling the AppDomain unhandled exception handler.
Wow guys that was fast! Thank you, and happy new year. By the way, am new to XamarinAndroid, so how will I be able to get this bugfix? Through nuget or through VS4Mac update? (And is there anyway to know the version number I should be looking for...?) Thanks! |
@knocte asked:
That depends on whether you need a "proper" commercial installer, or if you can use just the OSS bits. The fix is only on master at present, and thus won't be released commercially until "d15-7"/Xamarin.Android 8.3. (Release date unknown.) If you can you the OSS builds, you can follow the steps within |
Fixes: xamarin/monodroid#1147 Changes: http://github.com/xamarin/monodroid/compare/27736a7ffc48d606ab45598f761e873f8572f46a...daa2fb6ca52ecfd0884177da5b57501bb4dda3c6 * xamarin/monodroid@daa2fb6ca: Bump to xamarin/xamarin-analysis@9524531 (#1149) * xamarin/monodroid@bca44d592: [tools/msbuild] <FastDeploy/> Length cannot be less than zero (#1148) * xamarin/monodroid@2df384fe2: [tools/msbuild] improve XA0010 error message (#1144) * xamarin/monodroid@b2da84d5f: [tools/msbuild] remove MSBuild targets related to the Xamarin Inspector (#1143)
Steps to Reproduce
Expected Behavior
Exception received by the Bar() method is of type FooException (or at least contains the FooException in the InnerException chain?)
Actual Behavior
Exception received by the Bar() method is of type JavaProxyThrowable, and its message is "Exception of type 'Android.Runtime.JavaProxyThrowable' was thrown". The only bit of "FooException" found in this exception object is in the stack trace, however this is not an acceptable way for the callers to find what exception was really thrown, especially because it would need to be platform-specific code (only Android exhibits this behaviour, other platforms don't).
Version Information
Visual Studio Community 2017 for Mac
Version 7.3.2 (build 12)
Installation UUID: fd06ff65-69de-47ae-8b99-ddf257032b7c
Runtime:
Mono 5.4.1.7 (2017-06/e66d9abbb27) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
NuGet
Version: 4.3.1.4445
.NET Core
Runtime: /usr/local/share/dotnet/dotnet
Runtime Version: 2.0.0
SDK: /usr/local/share/dotnet/sdk/2.0.0/Sdks
SDK Version: 2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Sdks
Xamarin.Profiler
Version: 1.6.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
Xamarin.Android
Version: 8.1.0.25 (Visual Studio Community)
Android SDK: /Users/andres/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
7.1 (API level 25)
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 26.0.2
SDK Build Tools Version: 26.0.3
Java SDK: /usr
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
Apple Developer Tools
Xcode 9.2 (13772)
Build 9C40b
Log File
(I don't believe there's need for a log file)
The text was updated successfully, but these errors were encountered: