public void Failure_Without_ExceptionDetails_should_not_group() { var grouper = new ExceptionTypeAndStackTraceMessageGrouper(); var failureWithoutExceptionDetails = new FailureDetails(); var classification = grouper.ClassifyFailure(failureWithoutExceptionDetails); Assert.IsNull(classification); }
static FailureDetails CreateFailureDetailsWithStackTrace(string stackTrace) { var failureWithEmptyStackTrace = new FailureDetails { Exception = new ExceptionDetails { StackTrace = stackTrace, ExceptionType = "exceptionType" } }; return failureWithEmptyStackTrace; }
FailureDetails ParseFailureDetails(Dictionary <string, string> headers) { var result = new FailureDetails(); DictionaryExtensions.CheckIfKeyExists("NServiceBus.TimeOfFailure", headers, s => result.TimeOfFailure = DateTimeExtensions.ToUtcDateTime(s)); result.Exception = GetException(headers); result.AddressOfFailingEndpoint = headers[FaultsHeaderKeys.FailedQ]; return(result); }
FailureDetails ParseFailureDetails(Dictionary<string, string> headers) { var result = new FailureDetails(); DictionaryExtensions.CheckIfKeyExists("NServiceBus.TimeOfFailure", headers, s => result.TimeOfFailure = DateTimeExtensions.ToUtcDateTime(s)); result.Exception = GetException(headers); result.AddressOfFailingEndpoint = headers[FaultsHeaderKeys.FailedQ]; return result; }
public string ClassifyFailure(FailureDetails failureDetails) { var exception = failureDetails.Exception; if (exception == null) return null; if(string.IsNullOrWhiteSpace(exception.StackTrace)) return GetNonStandardClassification(exception.ExceptionType); var firstStackTraceFrame = StackTraceParser.Parse(exception.StackTrace).FirstOrDefault(); if (firstStackTraceFrame != null) return exception.ExceptionType + ": " + firstStackTraceFrame.ToMethodIdentifier(); return GetNonStandardClassification(exception.ExceptionType); }