Skip to content

Commit

Permalink
Include stack traces in error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
alchemistmatt committed Aug 27, 2024
1 parent f6abecb commit 25172d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MSFileInfoScanner/Readers/MSFileInfoProcessorBaseClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ protected void LoadScanDataWithProteoWizard(
}
catch (Exception ex)
{
OnErrorEvent("Error using ProteoWizard reader", ex);
OnErrorEvent(string.Format("Error using ProteoWizard reader; {0}", StackTraceFormatter.GetExceptionStackTrace(ex)), ex);
}
}

Expand Down
7 changes: 6 additions & 1 deletion MSFileInfoScanner/Readers/ProteowizardDataParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,12 @@ public bool StoreMSSpectraInfo(ProteoWizardParserInfo parserInfo)
}
catch (Exception ex)
{
OnErrorEvent(string.Format("Error reading instrument data with ProteoWizard: {0}", ex.Message), ex);
var stackTraceIfMissing = ex.Message.IndexOf("Stack trace:", StringComparison.OrdinalIgnoreCase) >= 0
? string.Empty
: StackTraceFormatter.GetExceptionStackTrace(ex);

OnErrorEvent(string.Format("Error reading instrument data with ProteoWizard: {0}; {1}", ex.Message, stackTraceIfMissing), ex);

return false;
}
}
Expand Down

0 comments on commit 25172d1

Please sign in to comment.