diff options
author | therzok <marius.ungureanu@xamarin.com> | 2019-05-22 21:34:34 +0300 |
---|---|---|
committer | therzok <marius.ungureanu@xamarin.com> | 2019-05-23 02:43:24 +0300 |
commit | b9b80ac9788dac80830e6d9988056aada9c4e02a (patch) | |
tree | 0460580b3d1abd88617d9a848e62c8a4e49d4c86 /main/src/addins/MacPlatform/MacPlatform.cs | |
parent | 36e0cdea4f2c83302ceed5797d1c127e9d9003e2 (diff) |
Properly add stacktraces to exceptions
Diffstat (limited to 'main/src/addins/MacPlatform/MacPlatform.cs')
-rw-r--r-- | main/src/addins/MacPlatform/MacPlatform.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/main/src/addins/MacPlatform/MacPlatform.cs b/main/src/addins/MacPlatform/MacPlatform.cs index 12a5d4a3b4..0142ab4174 100644 --- a/main/src/addins/MacPlatform/MacPlatform.cs +++ b/main/src/addins/MacPlatform/MacPlatform.cs @@ -249,7 +249,7 @@ namespace MonoDevelop.MacIntegration var nsException = ObjCRuntime.Runtime.GetNSObject<NSException> (exceptionPtr); try { - throw new MarshalledObjCException (nsException); + throw new MarshalledObjCException (nsException, Environment.StackTrace); } catch (MarshalledObjCException e) { // Is there a way to figure out if it's going to crash us? Maybe check MarshalObjectiveCExceptionMode and MarshalManagedExceptionMode? LoggingService.LogInternalError ("Unhandled ObjC exception", e); @@ -260,9 +260,12 @@ namespace MonoDevelop.MacIntegration sealed class MarshalledObjCException : ObjCException { - public MarshalledObjCException (NSException exception) : base (exception) + public MarshalledObjCException (NSException exception, string stacktrace) : base (exception) { + StackTrace = stacktrace; } + + public override string StackTrace { get; } } [DllImport (FoundationLib)] |