/// <summary>
        /// We don't assume order between java crash handler and c# crash handler.
        /// This method is called after either of those 2 events and is thus effective only the second time when we got both the c# exception and the Android error log.
        /// </summary>
        private static void JoinExceptionAndLog()
        {
            /*
             * We don't assume order between java crash handler and c# crash handler.
             * This method is called after either of those 2 events.
             * It is thus effective only the second time when we got both the .NET exception and the Android error log.
             */
            if (_errorLog != null && _exception != null)
            {
                /*
                 * Generate structured data for the C# exception and overwrite the Java exception to enhance it.
                 * Unless if we have java exception in top cause, this would make it worse.
                 * Having java exception as intermediate cause is better with .NET stack structure though.
                 */
                if (!(_exception is Java.Lang.Exception))
                {
                    _errorLog.Exception = GenerateModelException(_exception);

                    /* Tell the Android SDK to overwrite the modified error log on disk. */
                    AndroidExceptionDataManager.SaveWrapperSdkErrorLog(_errorLog);
                }

                /* Save the System.Exception to disk as a serialized object for client side inspection. */
                byte[] exceptionData = CrashesUtils.SerializeException(_exception);
                AndroidExceptionDataManager.SaveWrapperExceptionData(exceptionData, _errorLog.Id);
            }
        }
Example #2
0
        /// <summary>
        /// We don't assume order between java crash handler and c# crash handler.
        /// This method is called after either of those 2 events and is thus effective only the second time when we got both the c# exception and the Android error log.
        /// </summary>
        private static void JoinExceptionAndLog()
        {
            /*
             * We don't assume order between java crash handler and c# crash handler.
             * This method is called after either of those 2 events.
             * It is thus effective only the second time when we got both the c# exception and the Android error log.
             */
            if (_errorLog != null && _exception != null)
            {
                /* Generate structured data for the C# exception and overwrite the Java exception. */
                _errorLog.Exception = GenerateModelException(_exception);

                /* Tell the Android SDK to overwrite the modified error log on disk. */
                AndroidExceptionDataManager.SaveWrapperSdkErrorLog(_errorLog);

                /* Save the System.Exception to disk as a serialized object. */
                byte[] exceptionData = CrashesUtils.SerializeException(_exception);
                AndroidExceptionDataManager.SaveWrapperExceptionData(exceptionData, _errorLog.Id);
            }
        }