Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Using objective-c exceptions in Xamarin.iOS

$
0
0

Hello,

I am trying to use a private third-party objective-c library. It has its own exceptions, and each exception comes with extra data. In particular, the library's exception (let's call it MySDKException) contains a value called "errorCode" which would be very useful in debugging as well as displaying useful error messages as per the library's documentation.

I have created bindings for the library. The exception binds to an "NSException" which can not be used in a C# try/catch block as it is not derived from System.Exception. However, I am able to catch the error using a "MonoTouchException". I can't find a way to get MySDKException's error code from the MonoTouchException.

Running the code that causes the exception uncatched gives me the following:
Error code: Foundation.MonoTouchException: Objective-C exception thrown. Name: MySDKException Reason:
As well as a large native stack trace.

Is there any way to get MySDKException from MonoTouchException? Or at least, the data from the MySDKException (error code)?

Thanks.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>