Example #1
0
        private static iOSException GenerateiOSException(Exception exception)
        {
            iOSException iosException = new iOSException();

            iosException.Type           = exception.GetType().FullName;
            iosException.Message        = exception.Message;
            iosException.Frames         = GenerateStackFrames(exception);
            iosException.WrapperSdkName = WrapperSdk.Name;

            var aggregateException = exception as AggregateException;
            List <iOSException> innerExceptions = new List <iOSException>();

            if (aggregateException?.InnerExceptions != null)
            {
                foreach (Exception innerException in aggregateException.InnerExceptions)
                {
                    innerExceptions.Add(GenerateiOSException(innerException));
                }
            }
            else if (exception.InnerException != null)
            {
                innerExceptions.Add(GenerateiOSException(exception.InnerException));
            }

            iosException.InnerExceptions = innerExceptions.Count > 0 ? innerExceptions.ToArray() : null;

            return(iosException);
        }
Example #2
0
        private static void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            iOSException exception = GenerateiOSException((Exception)e.ExceptionObject);

            iOS.Bindings.MSWrapperExceptionManager.SetWrapperException(exception);
        }