Skip to content

Commit

Permalink
FIX : System.Environment.StackTrack throw exception in iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
baskren committed Oct 27, 2023
1 parent d67e81a commit bdad3e3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion Forms9Patch/Forms9Patch/Services/Debug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,20 @@ public static async Task RequestUserHelp(Exception e, string additionalInfo= nul
info += "\n\nPlatform : " + Xamarin.Essentials.DeviceInfo.Platform;
info += "\n\nVersion : " + Xamarin.Essentials.DeviceInfo.Version;
info += "\n\nVersionString : " + Xamarin.Essentials.DeviceInfo.VersionString;
info += "\n\nStack Trace: " + (e?.StackTrace ?? Environment.StackTrace);

var traceText = e?.StackTrace;
if (string.IsNullOrWhiteSpace(traceText))
{
try
{

var stackTrace = new System.Diagnostics.StackTrace();
traceText = stackTrace.ToString();
}
catch (Exception) { }
}

info += "\n\nStack Trace: " + traceText;// ?? Environment.StackTrace);
try
{
var message = new EmailMessage
Expand Down
2 changes: 1 addition & 1 deletion P42.Utils

0 comments on commit bdad3e3

Please sign in to comment.