[ObjCRuntime] Unwrap TargetInvocationExceptions we get when invoking methods using reflection.#11733
Merged
rolfbjarne merged 1 commit intoMay 31, 2021
Conversation
…methods using reflection.
Fixes this unit test:
[FAIL] ManagedExceptionPassthrough : exception
Expected: same as <System.ApplicationException: 3,14
at MonoTouchFixtures.ObjCRuntime.ExceptionsTest.ManagedExceptionTest.ThrowManagedException() in xamarin-macios/tests/monotouch-test/ObjCRuntime/ExceptionsTest.cs:line 128>
But was: <System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.ApplicationException: 3,14
at MonoTouchFixtures.ObjCRuntime.ExceptionsTest.ManagedExceptionTest.ThrowManagedException() in xamarin-macios/tests/monotouch-test/ObjCRuntime/ExceptionsTest.cs:line 128
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) in System.Private.CoreLib.dll:token 0x6004d2a+0x0
at ObjCRuntime.Runtime.InvokeMethod(MethodBase method, Object instance, IntPtr native_parameters) in Xamarin.Mac.dll:token 0x60011d1+0x254
at ObjCRuntime.Runtime.InvokeMethod(MonoObject* methodobj, MonoObject* instanceobj, IntPtr native_parameters) in Xamarin.Mac.dll:token 0x60011d0+0x0
at ObjCRuntime.Runtime.bridge_runtime_invoke_method(MonoObject* method, MonoObject* instance, IntPtr parameters, IntPtr& exception_gchandle) in Xamarin.Mac.dll:token 0x6001124+0x26
at ApiDefinition.Messaging.void_objc_msgSendSuper(IntPtr receiver, IntPtr selector)
at Bindings.Test.ObjCExceptionTest.InvokeManagedExceptionThrower() in xamarin-macios/tests/xharness/tmp-test-dir/monotouch-test2683/obj/Debug/net6.0-macos/macOS/Bindings.Test/ObjCExceptionTest.g.cs:line 105
at MonoTouchFixtures.ObjCRuntime.ExceptionsTest.ManagedExceptionPassthrough() in xamarin-macios/tests/monotouch-test/ObjCRuntime/ExceptionsTest.cs:line 154>
at MonoTouchFixtures.ObjCRuntime.ExceptionsTest.ManagedExceptionPassthrough() in xamarin-macios/tests/monotouch-test/ObjCRuntime/ExceptionsTest.cs:line 159
spouliot
approved these changes
May 28, 2021
tj-devel709
approved these changes
May 28, 2021
mandel-macaque
approved these changes
May 28, 2021
Collaborator
❌ [PR Build] Tests failed on Build ❌Tests failed on Build. API diff✅ API Diff from stable View API diffAPI & Generator diff✅ API Diff (from PR only) (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): Test results2 tests failed, 107 tests passed.Failed tests
Pipeline on Agent XAMBOT-1096.BigSur' |
Therzok
approved these changes
May 29, 2021
This was referenced May 31, 2021
Member
Author
|
Test failures are unrelated:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes this unit test: