xamarin-macios/tests/api-shared
Rolf Bjarne Kvinge e110612118
[registrar] Improve error message when failing to create a managed wrapper for a native handle. (#4360)
* Convert it into a MM8027/MT8027 error (with documentation).
* Add information about the selector and managed method that triggered the error.

Now the problem reported in issue #4254 shows up as:

> ObjCRuntime.RuntimeException: Failed to marshal the Objective-C object 0x7f8080412810 (type: UIView). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'UIKit.UIView&' does not have a constructor that takes one IntPtr argument).
> Additional information:
> 	Selector: popoverController:willRepositionPopoverToRect:inView:
> 	Method: UIKit.UIPopoverController+_UIPopoverControllerDelegate.WillReposition(UIKit.UIPopoverController, CoreGraphics.CGRect ByRef, UIKit.UIView ByRef)

instead of just:

> ObjCRuntime.RuntimeException: Failed to marshal the Objective-C object 0x7f8080412810 (type: UIView). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'UIKit.UIView&' does not have a constructor that takes one IntPtr argument).

which makes it much easier to understand, track down, and fix/work around,
both for customers and ourselves.
2018-06-29 14:38:28 +02:00
..
CoreFoundation [CoreFoundation] Fix bug 44399 - ArgumentNullException in AddObserver (#921) 2016-09-29 13:35:29 -04:00
ObjCRuntime [registrar] Improve error message when failing to create a managed wrapper for a native handle. (#4360) 2018-06-29 14:38:28 +02:00