Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace ServiceControl.Recoverability
{
using System.Linq;
using System.Text.RegularExpressions;

public class ExceptionTypeAndStackTraceFailureClassifier : IFailureClassifier
{
Expand Down Expand Up @@ -28,21 +29,28 @@ public string ClassifyFailure(ClassifiableMessageDetails failure)
// We need to remove the message in order to make sure the stack trace parser does not get into catastrophic backtracking mode.
exceptionStackTrace = exceptionStackTrace.Replace(exception.Message, string.Empty);
}

var firstStackTraceFrame = StackTraceParser.Parse(exceptionStackTrace, (frame, type, method, parameterList, parameters, file, line) => new StackFrame
try
{
Type = type,
Method = method,
Params = parameterList,
File = file,
Line = line
}).FirstOrDefault();
var firstStackTraceFrame = StackTraceParser.Parse(exceptionStackTrace, (frame, type, method, parameterList, parameters, file, line) => new StackFrame
{
Type = type,
Method = method,
Params = parameterList,
File = file,
Line = line
}).FirstOrDefault();

if (firstStackTraceFrame != null)
if (firstStackTraceFrame != null)
{
return exception.ExceptionType + ": " + firstStackTraceFrame.ToMethodIdentifier();
}
}
catch (RegexMatchTimeoutException)
{
return exception.ExceptionType + ": " + firstStackTraceFrame.ToMethodIdentifier();
// Intentionally empty - if the parsing fails, treat it as if exception.Message is null or empty, not throw an exception
}


return GetNonStandardClassification(exception.ExceptionType);
}

Expand Down