fix: only include first line of exception in troubleshooting context

This commit is contained in:
goaaats 2022-01-07 22:03:48 +01:00
parent 9c30a36cd0
commit 3059960fab
No known key found for this signature in database
GPG key ID: F18F057873895461

View file

@ -33,11 +33,13 @@ namespace Dalamud.Support
{ {
LastException = exception; LastException = exception;
var fixedContext = context?.Split(new []{'\r', '\n'}, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault();
try try
{ {
var payload = new ExceptionPayload var payload = new ExceptionPayload
{ {
Context = context, Context = fixedContext,
When = DateTime.Now, When = DateTime.Now,
Info = exception.ToString(), Info = exception.ToString(),
}; };
@ -92,7 +94,7 @@ namespace Dalamud.Support
public string Info { get; set; } public string Info { get; set; }
public string Context { get; set; } public string? Context { get; set; }
} }
private class TroubleshootingPayload private class TroubleshootingPayload