From e54200c55590575d1f92ff0543dd58f3c1491896 Mon Sep 17 00:00:00 2001 From: Matan Green Date: Fri, 9 Aug 2024 14:38:53 +0300 Subject: [PATCH] Hashing exceptions with normalization + improved diagnostic capabilities --- .../CachedDoneExceptions.cs | 6 +- .../CachedItems.cs | 30 +++-- .../ExceptionNormalizer.cs | 107 ++++++++++++++++++ .../ExceptionReplayDiagnosticTagNames.cs | 4 +- .../ExceptionTrackManager.cs | 91 +++++++++------ .../TestExceptionNormalizer.cs | 36 ++++++ .../TrackedExceptionCase.cs | 7 +- ...ebugger_probes_instrumentation_requester.h | 2 +- .../ExceptionNormalizerTests.1.verified.txt | 39 +++++++ .../ExceptionNormalizerTests.10.verified.txt | 5 + .../ExceptionNormalizerTests.11.verified.txt | 7 ++ .../ExceptionNormalizerTests.12.verified.txt | 3 + .../ExceptionNormalizerTests.13.verified.txt | 3 + .../ExceptionNormalizerTests.14.verified.txt | 3 + .../ExceptionNormalizerTests.15.verified.txt | 3 + .../ExceptionNormalizerTests.16.verified.txt | 4 + .../ExceptionNormalizerTests.17.verified.txt | 7 ++ .../ExceptionNormalizerTests.18.verified.txt | 7 ++ .../ExceptionNormalizerTests.19.verified.txt | 6 + .../ExceptionNormalizerTests.2.verified.txt | 39 +++++++ .../ExceptionNormalizerTests.20.verified.txt | 6 + .../ExceptionNormalizerTests.21.verified.txt | 7 ++ .../ExceptionNormalizerTests.22.verified.txt | 4 + .../ExceptionNormalizerTests.23.verified.txt | 7 ++ .../ExceptionNormalizerTests.24.verified.txt | 4 + .../ExceptionNormalizerTests.25.verified.txt | 7 ++ .../ExceptionNormalizerTests.26.verified.txt | 7 ++ .../ExceptionNormalizerTests.27.verified.txt | 7 ++ .../ExceptionNormalizerTests.28.verified.txt | 33 ++++++ .../ExceptionNormalizerTests.29.verified.txt | 32 ++++++ .../ExceptionNormalizerTests.3.verified.txt | 38 +++++++ .../ExceptionNormalizerTests.30.verified.txt | 33 ++++++ .../ExceptionNormalizerTests.31.verified.txt | 32 ++++++ .../ExceptionNormalizerTests.4.verified.txt | 38 +++++++ .../ExceptionNormalizerTests.5.verified.txt | 39 +++++++ .../ExceptionNormalizerTests.6.verified.txt | 38 +++++++ .../ExceptionNormalizerTests.7.verified.txt | 4 + .../ExceptionNormalizerTests.8.verified.txt | 5 + .../ExceptionNormalizerTests.9.verified.txt | 4 + .../ExceptionNormalizerTests.cs | 86 ++++++++++++++ 40 files changed, 783 insertions(+), 57 deletions(-) create mode 100644 tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/ExceptionNormalizer.cs create mode 100644 tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/TestExceptionNormalizer.cs create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.1.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.10.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.11.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.12.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.13.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.14.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.15.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.16.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.17.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.18.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.19.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.2.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.20.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.21.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.22.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.23.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.24.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.25.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.26.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.27.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.28.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.29.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.3.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.30.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.31.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.4.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.5.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.6.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.7.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.8.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.9.verified.txt create mode 100644 tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.cs diff --git a/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/CachedDoneExceptions.cs b/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/CachedDoneExceptions.cs index 88b83c3584c8..4e4fa97e747f 100644 --- a/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/CachedDoneExceptions.cs +++ b/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/CachedDoneExceptions.cs @@ -20,17 +20,17 @@ internal static class CachedDoneExceptions { private static readonly CachedItems _cachedDoneExceptions = new CachedItems(); - internal static void Add(string item) + internal static void Add(int item) { _cachedDoneExceptions.Add(item); } - internal static bool Remove(string item) + internal static bool Remove(int item) { return _cachedDoneExceptions.Remove(item); } - internal static bool Contains(string item) + internal static bool Contains(int item) { return _cachedDoneExceptions.Contains(item); } diff --git a/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/CachedItems.cs b/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/CachedItems.cs index ffb54f81eda6..6bdd62002623 100644 --- a/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/CachedItems.cs +++ b/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/CachedItems.cs @@ -18,48 +18,46 @@ namespace Datadog.Trace.Debugger.ExceptionAutoInstrumentation { internal class CachedItems { - private readonly HashSet cache = new(); - private readonly ReaderWriterLockSlim cacheLocker = new(); + private readonly HashSet _cache = new(); + private readonly ReaderWriterLockSlim _cacheLocker = new(); - internal void Add(string item) + internal void Add(int item) { - cacheLocker.EnterWriteLock(); + _cacheLocker.EnterWriteLock(); try { - cache.Add(Hash(item)); + _cache.Add(item); } finally { - cacheLocker.ExitWriteLock(); + _cacheLocker.ExitWriteLock(); } } - internal bool Remove(string item) + internal bool Remove(int item) { - cacheLocker.EnterWriteLock(); + _cacheLocker.EnterWriteLock(); try { - return cache.Remove(Hash(item)); + return _cache.Remove(item); } finally { - cacheLocker.ExitWriteLock(); + _cacheLocker.ExitWriteLock(); } } - internal bool Contains(string item) + internal bool Contains(int item) { - cacheLocker.EnterReadLock(); + _cacheLocker.EnterReadLock(); try { - return cache.Contains(Hash(item)); + return _cache.Contains(item); } finally { - cacheLocker.ExitReadLock(); + _cacheLocker.ExitReadLock(); } } - - private int Hash(string item) => Fnv1aHash.GetFNVHashCode(StringEncoding.UTF8.GetBytes(item)); } } diff --git a/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/ExceptionNormalizer.cs b/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/ExceptionNormalizer.cs new file mode 100644 index 000000000000..d3bd352d9607 --- /dev/null +++ b/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/ExceptionNormalizer.cs @@ -0,0 +1,107 @@ +// +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. +// + +using System; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Text; +using Datadog.Trace.VendoredMicrosoftCode.System; +using Fnv1aHash = Datadog.Trace.VendoredMicrosoftCode.System.Reflection.Internal.Hash; +using MemoryExtensions = Datadog.Trace.Debugger.Helpers.MemoryExtensions; + +#nullable enable +namespace Datadog.Trace.Debugger.ExceptionAutoInstrumentation +{ + internal class ExceptionNormalizer + { + /// + /// Given the string representation of an exception alongside it's FQN of the outer and (potential) inner exception, + /// this function cleanse the stack trace from error messages, customized information attached to the exception and PDB line info if present. + /// It returns a hash representing the resulting cleansed exception and inner exceptions. + /// Used to aggregate same/similar exceptions that only differ by non-relevant bits. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal int NormalizeAndHashException(string exceptionString, string outerExceptionType, string? innerExceptionType) + { + if (string.IsNullOrEmpty(exceptionString)) + { + throw new ArgumentException(@"Exception string cannot be null or empty", nameof(exceptionString)); + } + + var fnvHashCode = Fnv1aHash.FnvOffsetBias; + + fnvHashCode = HashLine(VendoredMicrosoftCode.System.MemoryExtensions.AsSpan(outerExceptionType), fnvHashCode); + + if (innerExceptionType != null) + { + fnvHashCode = HashLine(VendoredMicrosoftCode.System.MemoryExtensions.AsSpan(innerExceptionType), fnvHashCode); + } + + var exceptionSpan = VendoredMicrosoftCode.System.MemoryExtensions.AsSpan(exceptionString); + + var inSpan = VendoredMicrosoftCode.System.MemoryExtensions.AsSpan(" in "); + + while (!exceptionSpan.IsEmpty) + { + var lineEndIndex = exceptionSpan.IndexOfAny('\r', '\n'); + VendoredMicrosoftCode.System.ReadOnlySpan line; + + if (lineEndIndex >= 0) + { + line = exceptionSpan.Slice(0, lineEndIndex); + exceptionSpan = exceptionSpan.Slice(lineEndIndex + 1); + if (!exceptionSpan.IsEmpty && exceptionSpan[0] == '\n') + { + exceptionSpan = exceptionSpan.Slice(1); + } + } + else + { + line = exceptionSpan; + exceptionSpan = default; + } + + if (IsStackTraceLine(line) && !IsLambdaFunctionLine(line)) + { + var index = VendoredMicrosoftCode.System.MemoryExtensions.IndexOf(line, inSpan); + fnvHashCode = HashLine(index > 0 ? line.Slice(0, index) : line, fnvHashCode); + } + } + + return fnvHashCode; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static bool IsStackTraceLine(VendoredMicrosoftCode.System.ReadOnlySpan line) + { + int i = 0; + + while (i < line.Length && char.IsWhiteSpace(line[i])) + { + i++; + } + + return line.Length - i >= 3 && line[i] == 'a' && line[i + 1] == 't' && line[i + 2] == ' '; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private static bool IsLambdaFunctionLine(VendoredMicrosoftCode.System.ReadOnlySpan line) + { + var lambdaSpan = VendoredMicrosoftCode.System.MemoryExtensions.AsSpan("lambda_"); + return VendoredMicrosoftCode.System.MemoryExtensions.Contains(line, lambdaSpan, StringComparison.Ordinal); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected virtual int HashLine(VendoredMicrosoftCode.System.ReadOnlySpan line, int fnvHashCode) + { + for (var i = 0; i < line.Length; i++) + { + fnvHashCode = Fnv1aHash.Combine((uint)line[i], fnvHashCode); + } + + return fnvHashCode; + } + } +} diff --git a/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/ExceptionReplayDiagnosticTagNames.cs b/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/ExceptionReplayDiagnosticTagNames.cs index e1c11ab5e996..67d0aa7530bd 100644 --- a/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/ExceptionReplayDiagnosticTagNames.cs +++ b/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/ExceptionReplayDiagnosticTagNames.cs @@ -18,7 +18,7 @@ namespace Datadog.Trace.Debugger.ExceptionAutoInstrumentation internal static class ExceptionReplayDiagnosticTagNames { public const string Eligible = nameof(Eligible); - public const string EmptyShadowStack = nameof(EmptyShadowStack); + public const string NotEligible = nameof(NotEligible); public const string ExceptionTrackManagerNotInitialized = nameof(ExceptionTrackManagerNotInitialized); public const string NotRootSpan = nameof(NotRootSpan); public const string ExceptionObjectIsNull = nameof(ExceptionObjectIsNull); @@ -27,7 +27,7 @@ internal static class ExceptionReplayDiagnosticTagNames public const string InvalidatedExceptionCase = nameof(InvalidatedExceptionCase); public const string CircuitBreakerIsOpen = nameof(CircuitBreakerIsOpen); public const string NonCachedDoneExceptionCase = nameof(NonCachedDoneExceptionCase); - public const string NotSupportedExceptionType = nameof(NotSupportedExceptionType); + public const string NoCustomerFrames = nameof(NoCustomerFrames); public const string NoFramesToInstrument = nameof(NoFramesToInstrument); public const string EmptyCallStackTreeWhileCollecting = nameof(EmptyCallStackTreeWhileCollecting); public const string InvalidatedCase = nameof(InvalidatedCase); diff --git a/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/ExceptionTrackManager.cs b/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/ExceptionTrackManager.cs index 8fc8f03e9b38..db6d7ad8170d 100644 --- a/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/ExceptionTrackManager.cs +++ b/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/ExceptionTrackManager.cs @@ -36,10 +36,11 @@ internal class ExceptionTrackManager private static readonly SemaphoreSlim WorkAvailable = new(0, int.MaxValue); private static readonly CancellationTokenSource Cts = new(); private static readonly ExceptionCaseScheduler ExceptionsScheduler = new(); + private static readonly ExceptionNormalizer ExceptionNormalizer = new(); private static readonly int MaxFramesToCapture = ExceptionDebugging.Settings.MaximumFramesToCapture; private static readonly TimeSpan RateLimit = ExceptionDebugging.Settings.RateLimit; private static readonly BasicCircuitBreaker ReportingCircuitBreaker = new(ExceptionDebugging.Settings.MaxExceptionAnalysisLimit, TimeSpan.FromSeconds(1)); - private static CachedItems _invalidatedCases = new CachedItems(); + private static readonly CachedItems EvaluateWithRootSpanCases = new(); private static Task? _exceptionProcessorTask; private static bool _isInitialized; @@ -51,7 +52,7 @@ private static async Task StartExceptionProcessingAsync(CancellationToken cancel while (ExceptionProcessQueue.TryDequeue(out var exception)) { - ProcessException(exception, ErrorOriginKind.HttpRequestFailure, rootSpan: null); + ProcessException(exception, 0, ErrorOriginKind.HttpRequestFailure, rootSpan: null); } } } @@ -61,7 +62,7 @@ public static void Report(Span span, Exception? exception) if (!_isInitialized) { Log.Information(exception, "Exception Track Manager is not initialized yet. Skipping the processing of an exception. Exception = {Exception}, Span = {Span}", exception?.ToString(), span); - SetDiagnosticTag(span, ExceptionReplayDiagnosticTagNames.ExceptionTrackManagerNotInitialized); + SetDiagnosticTag(span, ExceptionReplayDiagnosticTagNames.ExceptionTrackManagerNotInitialized, 0); return; } @@ -74,7 +75,7 @@ public static void Report(Span span, Exception? exception) var failureReason = span.IsRootSpan == false ? ExceptionReplayDiagnosticTagNames.NotRootSpan : exception == null ? ExceptionReplayDiagnosticTagNames.ExceptionObjectIsNull : ExceptionReplayDiagnosticTagNames.NonSupportedExceptionType; - SetDiagnosticTag(span, failureReason); + SetDiagnosticTag(span, failureReason, 0); return; } @@ -91,19 +92,19 @@ public static void Report(Span span, Exception? exception) private static void ReportInternal(Exception exception, ErrorOriginKind errorOrigin, Span rootSpan) { var exToString = exception.ToString(); + var normalizedExHash = ExceptionNormalizer.NormalizeAndHashException(exToString, exception.GetType().Name, exception.InnerException?.GetType().Name); - if (CachedDoneExceptions.Contains(exToString)) + if (CachedDoneExceptions.Contains(normalizedExHash)) { // Quick exit. - SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.CachedDoneExceptionCase); + SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.CachedDoneExceptionCase, normalizedExHash); return; } - if (_invalidatedCases.Contains(exToString)) + if (EvaluateWithRootSpanCases.Contains(normalizedExHash)) { - Log.Information("Encountered invalidated exception.ToString(), exception: {Exception}", exToString); - SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.InvalidatedExceptionCase); - ProcessException(exception, errorOrigin, rootSpan); + Log.Information("Encountered an exception that should be handled with root span, exception: {Exception}", exToString); + ProcessException(exception, normalizedExHash, errorOrigin, rootSpan); return; } @@ -114,25 +115,25 @@ private static void ReportInternal(Exception exception, ErrorOriginKind errorOri Log.Debug(exception, "The circuit breaker is opened, skipping the processing of an exception."); } - SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.CircuitBreakerIsOpen); + SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.CircuitBreakerIsOpen, normalizedExHash); return; } var nonEmptyShadowStack = ShadowStackHolder.IsShadowStackTrackingEnabled && ShadowStackHolder.ShadowStack!.ContainsReport(exception); if (nonEmptyShadowStack) { - SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.Eligible); - ProcessException(exception, errorOrigin, rootSpan); + SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.Eligible, normalizedExHash); + ProcessException(exception, normalizedExHash, errorOrigin, rootSpan); } else { - SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.EmptyShadowStack); + SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.NotEligible, normalizedExHash); ExceptionProcessQueue.Enqueue(exception); WorkAvailable.Release(); } } - private static void ProcessException(Exception exception, ErrorOriginKind errorOrigin, Span? rootSpan) + private static void ProcessException(Exception exception, int normalizedExHash, ErrorOriginKind errorOrigin, Span? rootSpan) { var allParticipatingFrames = GetAllExceptionRelatedStackFrames(exception); var allParticipatingFramesFlattened = allParticipatingFrames.GetAllFlattenedFrames().Reverse().ToArray(); @@ -141,7 +142,13 @@ private static void ProcessException(Exception exception, ErrorOriginKind errorO { if (rootSpan != null) { - SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.NoFramesToInstrument); + SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.NoFramesToInstrument, normalizedExHash); + CachedDoneExceptions.Add(normalizedExHash); + EvaluateWithRootSpanCases.Remove(normalizedExHash); + } + else + { + EvaluateWithRootSpanCases.Add(normalizedExHash); } return; @@ -151,17 +158,24 @@ private static void ProcessException(Exception exception, ErrorOriginKind errorO { if (rootSpan != null) { - SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.NotSupportedExceptionType); + SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.NoCustomerFrames, normalizedExHash); + CachedDoneExceptions.Add(normalizedExHash); + EvaluateWithRootSpanCases.Remove(normalizedExHash); + } + else + { + EvaluateWithRootSpanCases.Add(normalizedExHash); } - Log.Information(exception, "Skipping the processing of an exception by Exception Debugging."); + Log.Information(exception, "Skipping the processing of an exception by Exception Debugging. All frames are 3rd party."); return; } var exceptionTypes = new HashSet(); var currentFrame = allParticipatingFrames; + var iterationLimit = 5; - while (currentFrame != null) + while (iterationLimit-- >= 0 && currentFrame != null) { exceptionTypes.Add(currentFrame.Exception.GetType()); currentFrame = currentFrame.InnerFrame; @@ -169,13 +183,21 @@ private static void ProcessException(Exception exception, ErrorOriginKind errorO var exceptionId = new ExceptionIdentifier(exceptionTypes, allParticipatingFramesFlattened, errorOrigin); - var trackedExceptionCase = TrackedExceptionCases.GetOrAdd(exceptionId, _ => new TrackedExceptionCase(exceptionId, exception.ToString())); + var trackedExceptionCase = TrackedExceptionCases.GetOrAdd(exceptionId, _ => + { + if (normalizedExHash == 0) + { + normalizedExHash = ExceptionNormalizer.NormalizeAndHashException(exception.ToString(), exception.GetType().Name, exception.InnerException?.GetType().Name); + } + + return new TrackedExceptionCase(exceptionId, exception.ToString(), normalizedExHash); + }); if (trackedExceptionCase.IsDone) { if (rootSpan != null) { - SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.NonCachedDoneExceptionCase); + SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.NonCachedDoneExceptionCase, trackedExceptionCase.NormalizedExceptionHash); } } else if (trackedExceptionCase.IsInvalidated) @@ -186,6 +208,8 @@ private static void ProcessException(Exception exception, ErrorOriginKind errorO return; } + SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.InvalidatedExceptionCase, trackedExceptionCase.NormalizedExceptionHash); + var allFrames = trackedExceptionCase.ExceptionCase.ExceptionId.StackTrace; var allProbes = trackedExceptionCase.ExceptionCase.Probes; var frameIndex = allFrames.Length - 1; @@ -212,7 +236,8 @@ private static void ProcessException(Exception exception, ErrorOriginKind errorO if (trackedExceptionCase.Revert()) { - CachedDoneExceptions.Add(trackedExceptionCase.ExceptionToString); + CachedDoneExceptions.Add(trackedExceptionCase.NormalizedExceptionHash); + EvaluateWithRootSpanCases.Remove(trackedExceptionCase.NormalizedExceptionHash); } } else if (trackedExceptionCase.IsCollecting) @@ -267,18 +292,19 @@ private static void ProcessException(Exception exception, ErrorOriginKind errorO { Log.Information("Invalidating the exception case of the empty stack tree since none of the methods were instrumented, for exception: {Name}, Message: {Message}, StackTrace: {StackTrace}", exception.GetType().Name, exception.Message, exception.StackTrace); trackedExceptionCase.InvalidateCase(); - _invalidatedCases.Add(exception.ToString()); + + EvaluateWithRootSpanCases.Add(trackedExceptionCase.NormalizedExceptionHash); if (rootSpan != null) { - SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.InvalidatedCase); + SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.InvalidatedCase, trackedExceptionCase.NormalizedExceptionHash); } } else { if (rootSpan != null) { - SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.EmptyCallStackTreeWhileCollecting); + SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.EmptyCallStackTreeWhileCollecting, trackedExceptionCase.NormalizedExceptionHash); } } @@ -378,7 +404,7 @@ private static void ProcessException(Exception exception, ErrorOriginKind errorO if (trackedExceptionCase.Revert()) { - CachedDoneExceptions.Add(trackedExceptionCase.ExceptionToString); + CachedDoneExceptions.Add(trackedExceptionCase.NormalizedExceptionHash); ExceptionsScheduler.Schedule(trackedExceptionCase, RateLimit); } } @@ -390,7 +416,7 @@ private static void ProcessException(Exception exception, ErrorOriginKind errorO if (rootSpan != null) { - SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.NewCase); + SetDiagnosticTag(rootSpan, ExceptionReplayDiagnosticTagNames.NewCase, trackedExceptionCase.NormalizedExceptionHash); } } } @@ -411,14 +437,12 @@ private static string GetNoCaptureReason(ParticipatingFrame frame, ExceptionDebu // Frame is non-optimized in .NET 6+. noCaptureReason = $"The method {frame.Method.GetFullyQualifiedName()} could not be captured because it resides in a module that is not optimized. In .NET 6 and later versions, the code must be compiled with optimizations enabled."; } - - if (probe.ProbeStatus == Status.ERROR) + else if (probe.ProbeStatus == Status.ERROR) { // Frame is failed to instrument. noCaptureReason = $"The method {frame.Method.GetFullyQualifiedName()} has failed in instrumentation. Failure reason: {probe.ErrorMessage}"; } - - if (probe.ProbeStatus == Status.RECEIVED) + else if (probe.ProbeStatus == Status.RECEIVED) { // Frame is failed to instrument. noCaptureReason = $"The method {frame.Method.GetFullyQualifiedName()} could not be found."; @@ -648,9 +672,10 @@ private static bool ShouldSkip(MethodBase method) } } - private static void SetDiagnosticTag(Span span, string tag) + private static void SetDiagnosticTag(Span span, string exceptionPhase, int exceptionHash) { - span.Tags.SetTag("_dd.di.er", tag); + span.Tags.SetTag("_dd.di._er", exceptionPhase); + span.Tags.SetTag("_dd.di._eh", exceptionHash.ToString()); } } } diff --git a/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/TestExceptionNormalizer.cs b/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/TestExceptionNormalizer.cs new file mode 100644 index 000000000000..a62f8bc17102 --- /dev/null +++ b/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/TestExceptionNormalizer.cs @@ -0,0 +1,36 @@ +// +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. +// + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +#nullable enable +namespace Datadog.Trace.Debugger.ExceptionAutoInstrumentation +{ + /// + /// Important: Should only be used in testing. Not thread-safe. + /// + internal class TestExceptionNormalizer : ExceptionNormalizer + { + private StringBuilder? _debug; + + internal int NormalizeAndHashException(string exceptionString, string outerExceptionType, string? innerExceptionType, StringBuilder debug) + { + _debug = debug; + var hash = NormalizeAndHashException(exceptionString, outerExceptionType, innerExceptionType); + _debug = null; + return hash; + } + + protected override int HashLine(VendoredMicrosoftCode.System.ReadOnlySpan line, int fnvHashCode) + { + _debug?.AppendLine(line.ToString()); + return base.HashLine(line, fnvHashCode); + } + } +} diff --git a/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/TrackedExceptionCase.cs b/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/TrackedExceptionCase.cs index 4193288fcb50..01b9bf3d8533 100644 --- a/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/TrackedExceptionCase.cs +++ b/tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/TrackedExceptionCase.cs @@ -21,10 +21,11 @@ internal class TrackedExceptionCase { private volatile int _initializationOrTearDownInProgress; - public TrackedExceptionCase(ExceptionIdentifier exceptionId, string exceptionToString) + public TrackedExceptionCase(ExceptionIdentifier exceptionId, string exceptionToString, int normalizedExceptionHash) { ExceptionIdentifier = exceptionId; ErrorHash = MD5HashProvider.GetHash(exceptionId); + NormalizedExceptionHash = normalizedExceptionHash; ExceptionToString = exceptionToString; StartCollectingTime = DateTime.MaxValue; } @@ -37,6 +38,8 @@ public TrackedExceptionCase(ExceptionIdentifier exceptionId, string exceptionToS public string ExceptionToString { get; } + public int NormalizedExceptionHash { get; } + public ExceptionCollectionState TrackingExceptionCollectionState { get; private set; } = ExceptionCollectionState.None; public bool IsDone => TrackingExceptionCollectionState == ExceptionCollectionState.Finalizing || TrackingExceptionCollectionState == ExceptionCollectionState.Done; @@ -76,7 +79,7 @@ public void Instrument() { var @case = ExceptionCaseInstrumentationManager.Instrument(ExceptionIdentifier); BeginCollect(@case); - CachedDoneExceptions.Remove(ExceptionToString); + CachedDoneExceptions.Remove(NormalizedExceptionHash); } } diff --git a/tracer/src/Datadog.Tracer.Native/debugger_probes_instrumentation_requester.h b/tracer/src/Datadog.Tracer.Native/debugger_probes_instrumentation_requester.h index 6ce752fa73ff..36fade86f1eb 100644 --- a/tracer/src/Datadog.Tracer.Native/debugger_probes_instrumentation_requester.h +++ b/tracer/src/Datadog.Tracer.Native/debugger_probes_instrumentation_requester.h @@ -59,7 +59,7 @@ class DebuggerProbesInstrumentationRequester void RequestRejitForLoadedModule(ModuleID moduleId); void ModuleLoadFinished_AddMetadataToModule(ModuleID moduleId); - HRESULT STDMETHODCALLTYPE ModuleLoadFinished(ModuleID moduleId); + HRESULT STDMETHODCALLTYPE ModuleLoadFinished(const ModuleID moduleId); static HRESULT NotifyReJITError(ModuleID moduleId, mdMethodDef methodId, FunctionID functionId, HRESULT hrStatus); }; diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.1.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.1.verified.txt new file mode 100644 index 000000000000..7f880a9a7e26 --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.1.verified.txt @@ -0,0 +1,39 @@ +Microsoft.Data.SqlClient.SqlException +System.ComponentModel.Win32Exception + at Microsoft.Data.SqlClient.SqlCommand.<>c.b__195_0(Task`1 result) + at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() + at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) + at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) + at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) + at Datadog.Trace.ClrProfiler.CallTarget.Handlers.Continuations.TaskContinuationGenerator`4.SyncCallbackHandler.ContinuationAction(Task`1 previousTask, TTarget target, CallTargetState state) + at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext() + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync() + at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken) + at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) + at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) + at Foo.Bar.Backend.Controllers.WorkOrdersController.GetStats(GetWorkOrderStatsRequestFooApi request) + at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) + at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) + at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) +Resulting Hash: 1442798754 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.10.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.10.verified.txt new file mode 100644 index 000000000000..8cd811f21314 --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.10.verified.txt @@ -0,0 +1,5 @@ +System.FormatException + at System.Number.StringToNumber(ReadOnlySpan`1 str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) + at System.Number.ParseInt32(ReadOnlySpan`1 s, NumberStyles style, NumberFormatInfo info) + at MyApp.Utilities.StringExtensions.ToInt32(String input) +Resulting Hash: 984514727 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.11.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.11.verified.txt new file mode 100644 index 000000000000..47e6b07b18cc --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.11.verified.txt @@ -0,0 +1,7 @@ +System.AggregateException +System.Net.Http.HttpRequestException + at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) + at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) + at MyApp.Controllers.UserController.CreateUserAsync(User user) + at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) +Resulting Hash: -1794848629 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.12.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.12.verified.txt new file mode 100644 index 000000000000..6b4c07ef276a --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.12.verified.txt @@ -0,0 +1,3 @@ +System.Exception + at MyApp.Program.Main(String[] args) +Resulting Hash: -52104551 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.13.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.13.verified.txt new file mode 100644 index 000000000000..e4e6643dd1f6 --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.13.verified.txt @@ -0,0 +1,3 @@ +System.IO.FileNotFoundException + at MyApp.Services.FileService.ReadFile(String path) +Resulting Hash: 1139672230 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.14.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.14.verified.txt new file mode 100644 index 000000000000..521be98814d8 --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.14.verified.txt @@ -0,0 +1,3 @@ +System.InvalidCastException + at MyApp.Models.User.set_Age(Object value) +Resulting Hash: -695137841 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.15.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.15.verified.txt new file mode 100644 index 000000000000..0034b9ab1396 --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.15.verified.txt @@ -0,0 +1,3 @@ +System.OutOfMemoryException + at MyApp.Services.LargeDataProcessor.ProcessLargeData() +Resulting Hash: -483162847 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.16.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.16.verified.txt new file mode 100644 index 000000000000..5ce105486dab --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.16.verified.txt @@ -0,0 +1,4 @@ +System.Threading.Tasks.TaskCanceledException + at MyApp.Services.HttpService.GetDataAsync(String url) + at MyApp.Controllers.DataController.GetData(String id) +Resulting Hash: -1447256799 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.17.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.17.verified.txt new file mode 100644 index 000000000000..0dd7e613ecdf --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.17.verified.txt @@ -0,0 +1,7 @@ +System.InvalidOperationException +System.NullReferenceException + at MyApp.Services.UserService.GetUserById(Int32 id) + at MyApp.Controllers.UserController.GetUser(Int32 id) + at MyApp.Middleware.LoggingMiddleware.Invoke(HttpContext context) + at MyApp.Services.UserService.FindUser(String name) +Resulting Hash: 1204061258 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.18.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.18.verified.txt new file mode 100644 index 000000000000..33120ff3e253 --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.18.verified.txt @@ -0,0 +1,7 @@ +System.ArgumentException +System.InvalidOperationException + at MyApp.Data.DatabaseContext.GetUserById(Int32 id) + at MyApp.Services.UserService.CreateUser(User user) + at MyApp.Controllers.UserController.CreateUser(User user) + at MyApp.Data.DatabaseContext.SaveChanges() +Resulting Hash: -1159361028 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.19.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.19.verified.txt new file mode 100644 index 000000000000..905b70f53644 --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.19.verified.txt @@ -0,0 +1,6 @@ +System.FormatException + at System.Number.StringToNumber(ReadOnlySpan`1 str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) + at System.Number.ParseInt32(ReadOnlySpan`1 s, NumberStyles style, NumberFormatInfo info) + at MyApp.Utilities.StringExtensions.ToInt32(String input) + at MyApp.Controllers.DataController.ConvertStringToInt(String value) +Resulting Hash: 1256306373 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.2.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.2.verified.txt new file mode 100644 index 000000000000..7f880a9a7e26 --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.2.verified.txt @@ -0,0 +1,39 @@ +Microsoft.Data.SqlClient.SqlException +System.ComponentModel.Win32Exception + at Microsoft.Data.SqlClient.SqlCommand.<>c.b__195_0(Task`1 result) + at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() + at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) + at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) + at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) + at Datadog.Trace.ClrProfiler.CallTarget.Handlers.Continuations.TaskContinuationGenerator`4.SyncCallbackHandler.ContinuationAction(Task`1 previousTask, TTarget target, CallTargetState state) + at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext() + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync() + at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken) + at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) + at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) + at Foo.Bar.Backend.Controllers.WorkOrdersController.GetStats(GetWorkOrderStatsRequestFooApi request) + at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) + at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) + at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) +Resulting Hash: 1442798754 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.20.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.20.verified.txt new file mode 100644 index 000000000000..26bc093be5c9 --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.20.verified.txt @@ -0,0 +1,6 @@ +System.InvalidOperationException +System.Data.SqlClient.SqlException + at MyApp.Controllers.HomeController.Index() + at Microsoft.AspNetCore.Mvc.ViewResultExecutor.Execute(ViewContext viewContext, String contentPath) + at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +Resulting Hash: -342878928 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.21.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.21.verified.txt new file mode 100644 index 000000000000..971bed6bbde4 --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.21.verified.txt @@ -0,0 +1,7 @@ +System.AggregateException +System.IO.IOException + at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) + at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) + at MyApp.Controllers.FileController.UploadFileAsync(IFormFile file) + at MyApp.Services.FileService.SaveFile(String path, IFormFile file) +Resulting Hash: -143139163 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.22.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.22.verified.txt new file mode 100644 index 000000000000..35cd239da1a6 --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.22.verified.txt @@ -0,0 +1,4 @@ +System.NullReferenceException + at MyApp.Services.CustomerService.GetCustomerDetails(Int32 customerId) + at MyApp.Controllers.CustomerController.GetCustomer(Int32 id) +Resulting Hash: -1275255239 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.23.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.23.verified.txt new file mode 100644 index 000000000000..5b959674c93e --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.23.verified.txt @@ -0,0 +1,7 @@ +System.InvalidOperationException +System.NullReferenceException + at MyApp.Services.OrderService.ProcessOrder(Int32 orderId) + at MyApp.Controllers.OrderController.CompleteOrder(Int32 id) + at MyApp.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) + at MyApp.Services.OrderService.ValidateOrder(Order order) +Resulting Hash: 996410317 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.24.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.24.verified.txt new file mode 100644 index 000000000000..3c8c1814be3f --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.24.verified.txt @@ -0,0 +1,4 @@ +System.ArgumentOutOfRangeException + at MyApp.Collections.CustomList`1.get_Item(Int32 index) + at MyApp.Controllers.CollectionController.GetItem(Int32 index) +Resulting Hash: -991079971 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.25.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.25.verified.txt new file mode 100644 index 000000000000..0dd7e613ecdf --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.25.verified.txt @@ -0,0 +1,7 @@ +System.InvalidOperationException +System.NullReferenceException + at MyApp.Services.UserService.GetUserById(Int32 id) + at MyApp.Controllers.UserController.GetUser(Int32 id) + at MyApp.Middleware.LoggingMiddleware.Invoke(HttpContext context) + at MyApp.Services.UserService.FindUser(String name) +Resulting Hash: 1204061258 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.26.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.26.verified.txt new file mode 100644 index 000000000000..afb5940db8ca --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.26.verified.txt @@ -0,0 +1,7 @@ +System.ArgumentException +System.NullReferenceException + at MyApp.Services.ValidationService.Validate(Object value) + at MyApp.Controllers.ValidationController.ValidateInput(Object input) + at MyApp.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) + at MyApp.Services.ValidationService.CheckNull(Object value) +Resulting Hash: 1739517613 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.27.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.27.verified.txt new file mode 100644 index 000000000000..914bd6651a0f --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.27.verified.txt @@ -0,0 +1,7 @@ +System.InvalidOperationException +System.Data.SqlClient.SqlException + at MyApp.Data.DbContext.ExecuteCommand(String command) + at MyApp.Services.CommandService.RunCommand(String command) + at MyApp.Controllers.CommandController.ExecuteCommand(String command) + at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() +Resulting Hash: 792588295 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.28.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.28.verified.txt new file mode 100644 index 000000000000..3de80f55d77e --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.28.verified.txt @@ -0,0 +1,33 @@ +Foo.Bar.Models.Exceptions.FOOException + at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.ValidateTransactions() + at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.CreatePayableInvoice() + at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.CreatePayableInvoice() + at Foo.Bar.Core.App.Transactions.<>c__DisplayClass17_0.<b__1>d.MoveNext() + at Foo.Bar.Core.App.Transactions.<>c__DisplayClass17_0.<b__1>d.MoveNext() + at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c.<b__3_0>d.MoveNext() + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext() + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) + at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) + at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) + at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) + at Foo.Bar.Backend.Controllers.TransactionsController.CreatePayableWithFiles(PayableRequest request) + at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) + at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) + at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) +Resulting Hash: 2058544774 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.29.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.29.verified.txt new file mode 100644 index 000000000000..ea30664dc387 --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.29.verified.txt @@ -0,0 +1,32 @@ +Foo.Bar.Models.Exceptions.FOOException + at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.ValidateTransactions() + at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.EditPayableInvoice() + at Foo.Bar.Core.App.Transactions.<>c__DisplayClass17_0.<b__1>d.MoveNext() + at Foo.Bar.Core.App.Transactions.<>c__DisplayClass17_0.<b__1>d.MoveNext() + at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c.<b__3_0>d.MoveNext() + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext() + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) + at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) + at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) + at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) + at Foo.Bar.Backend.Controllers.TransactionsController.EditPayableWithFiles(PayableRequest request) + at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) + at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) + at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) +Resulting Hash: -1716466196 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.3.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.3.verified.txt new file mode 100644 index 000000000000..480450ff5dc9 --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.3.verified.txt @@ -0,0 +1,38 @@ +Microsoft.Data.SqlClient.SqlException + at Microsoft.Data.SqlClient.SqlCommand.<>c.b__195_0(Task`1 result) + at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() + at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) + at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) + at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) + at Datadog.Trace.ClrProfiler.CallTarget.Handlers.Continuations.TaskContinuationGenerator`4.SyncCallbackHandler.ContinuationAction(Task`1 previousTask, TTarget target, CallTargetState state) + at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext() + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync() + at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken) + at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) + at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) + at Foo.Bar.Backend.Controllers.WorkOrdersController.GetStats(GetWorkOrderStatsRequestFooApi request) + at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) + at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) + at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) +Resulting Hash: 1191872131 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.30.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.30.verified.txt new file mode 100644 index 000000000000..3de80f55d77e --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.30.verified.txt @@ -0,0 +1,33 @@ +Foo.Bar.Models.Exceptions.FOOException + at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.ValidateTransactions() + at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.CreatePayableInvoice() + at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.CreatePayableInvoice() + at Foo.Bar.Core.App.Transactions.<>c__DisplayClass17_0.<b__1>d.MoveNext() + at Foo.Bar.Core.App.Transactions.<>c__DisplayClass17_0.<b__1>d.MoveNext() + at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c.<b__3_0>d.MoveNext() + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext() + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) + at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) + at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) + at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) + at Foo.Bar.Backend.Controllers.TransactionsController.CreatePayableWithFiles(PayableRequest request) + at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) + at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) + at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) +Resulting Hash: 2058544774 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.31.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.31.verified.txt new file mode 100644 index 000000000000..ea30664dc387 --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.31.verified.txt @@ -0,0 +1,32 @@ +Foo.Bar.Models.Exceptions.FOOException + at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.ValidateTransactions() + at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.EditPayableInvoice() + at Foo.Bar.Core.App.Transactions.<>c__DisplayClass17_0.<b__1>d.MoveNext() + at Foo.Bar.Core.App.Transactions.<>c__DisplayClass17_0.<b__1>d.MoveNext() + at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c.<b__3_0>d.MoveNext() + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext() + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) + at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) + at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) + at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) + at Foo.Bar.Backend.Controllers.TransactionsController.EditPayableWithFiles(PayableRequest request) + at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) + at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) + at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) +Resulting Hash: -1716466196 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.4.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.4.verified.txt new file mode 100644 index 000000000000..3c53f256752d --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.4.verified.txt @@ -0,0 +1,38 @@ +Microsoft.Data.SqlClient.SqlException2 + at Microsoft.Data.SqlClient.SqlCommand.<>c.b__195_0(Task`1 result) + at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() + at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) + at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) + at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) + at Datadog.Trace.ClrProfiler.CallTarget.Handlers.Continuations.TaskContinuationGenerator`4.SyncCallbackHandler.ContinuationAction(Task`1 previousTask, TTarget target, CallTargetState state) + at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext() + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync() + at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken) + at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) + at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) + at Foo.Bar.Backend.Controllers.WorkOrdersController.GetStats(GetWorkOrderStatsRequestFooApi request) + at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) + at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) + at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) +Resulting Hash: 1762422669 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.5.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.5.verified.txt new file mode 100644 index 000000000000..48054ad67bfe --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.5.verified.txt @@ -0,0 +1,39 @@ +Microsoft.Data.SqlClient.SqlException2 +System.ComponentModel.Win32Exception + at Microsoft.Data.SqlClient.SqlCommand.<>c.b__195_0(Task`1 result) + at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() + at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) + at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) + at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) + at Datadog.Trace.ClrProfiler.CallTarget.Handlers.Continuations.TaskContinuationGenerator`4.SyncCallbackHandler.ContinuationAction(Task`1 previousTask, TTarget target, CallTargetState state) + at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext() + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync() + at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken) + at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) + at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) + at Foo.Bar.Backend.Controllers.WorkOrdersController.GetStats(GetWorkOrderStatsRequestFooApi request) + at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) + at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) + at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) +Resulting Hash: -319232788 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.6.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.6.verified.txt new file mode 100644 index 000000000000..3c53f256752d --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.6.verified.txt @@ -0,0 +1,38 @@ +Microsoft.Data.SqlClient.SqlException2 + at Microsoft.Data.SqlClient.SqlCommand.<>c.b__195_0(Task`1 result) + at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() + at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) + at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) + at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) + at Datadog.Trace.ClrProfiler.CallTarget.Handlers.Continuations.TaskContinuationGenerator`4.SyncCallbackHandler.ContinuationAction(Task`1 previousTask, TTarget target, CallTargetState state) + at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext() + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync() + at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken) + at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken) + at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) + at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) + at Foo.Bar.Backend.Controllers.WorkOrdersController.GetStats(GetWorkOrderStatsRequestFooApi request) + at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker) + at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) + at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) + at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) + at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) +Resulting Hash: 1762422669 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.7.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.7.verified.txt new file mode 100644 index 000000000000..07d7d8749419 --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.7.verified.txt @@ -0,0 +1,4 @@ +System.NullReferenceException + at MyApp.Services.UserService.GetUserById(Int32 id) + at MyApp.Controllers.UserController.GetUser(Int32 id) +Resulting Hash: -2064745795 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.8.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.8.verified.txt new file mode 100644 index 000000000000..fec83a19bd18 --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.8.verified.txt @@ -0,0 +1,5 @@ +System.InvalidOperationException + at MyApp.Data.DatabaseContext.SaveChanges() + at MyApp.Services.UserService.CreateUser(User user) + at MyApp.Services.UserService.CreateUser(User user) +Resulting Hash: -1962392110 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.9.verified.txt b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.9.verified.txt new file mode 100644 index 000000000000..144407ac3393 --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.9.verified.txt @@ -0,0 +1,4 @@ +System.ArgumentNullException + at MyApp.Services.UserService.UpdateUser(User user) + at MyApp.Controllers.UserController.UpdateUser(User user) +Resulting Hash: 457877481 diff --git a/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.cs b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.cs new file mode 100644 index 000000000000..531e7361e0fc --- /dev/null +++ b/tracer/test/Datadog.Trace.Debugger.IntegrationTests/ExceptionNormalizerTests.cs @@ -0,0 +1,86 @@ +// +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc. +// + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Text; +using System.Threading.Tasks; +using Datadog.Trace.Debugger.Configurations.Models; +using Datadog.Trace.Debugger.ExceptionAutoInstrumentation; +using Datadog.Trace.Debugger.IntegrationTests.Helpers; +using Datadog.Trace.Debugger.Models; +using FluentAssertions; +using Samples.Probes.TestRuns.SmokeTests; +using VerifyTests; +using VerifyXunit; +using Xunit; +using Xunit.Abstractions; + +#nullable enable +namespace Datadog.Trace.Debugger.IntegrationTests +{ + [UsesVerify] + public class ExceptionNormalizerTests + { + private readonly ITestOutputHelper _testOutputHelper; + + public ExceptionNormalizerTests(ITestOutputHelper testOutputHelper) + { + _testOutputHelper = testOutputHelper; + } + + [Theory] + [InlineData(1, "Microsoft.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.\r\n ---> System.ComponentModel.Win32Exception (258): Unknown error 258\r\n at Microsoft.Data.SqlClient.SqlCommand.<>c.b__195_0(Task`1 result)\r\n at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n--- End of stack trace from previous location ---\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)\r\n--- End of stack trace from previous location ---\r\n at Datadog.Trace.ClrProfiler.CallTarget.Handlers.Continuations.TaskContinuationGenerator`4.SyncCallbackHandler.ContinuationAction(Task`1 previousTask, TTarget target, CallTargetState state) in /project/tracer/src/Datadog.Trace/ClrProfiler/CallTarget/Handlers/Continuations/TaskContinuationGenerator`1.cs:line 140\r\n at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()\r\n at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)\r\n at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) in /builds/programmers/foo-api/Foo.Bar.Core/App/WorkOrders.cs:line 786\r\n at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) in /builds/programmers/foo-api/Foo.Bar.Core/App/WorkOrders.cs:line 801\r\n at Foo.Bar.Backend.Controllers.WorkOrdersController.GetStats(GetWorkOrderStatsRequestFooApi request) in /builds/programmers/foo-api/Foo.Bar.Backend/Controllers/WorkOrdersController.cs:line 138\r\n at lambda_method6365(Closure, Object)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/GetCompanyMiddleware.cs:line 61\r\n at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckRouteMiddleware.cs:line 28\r\n at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckAccessMiddleware.cs:line 57\r\n at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) in /project/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AspNetCore/BlockingMiddleware.cs:line 115\r\n at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/ErrorHandlingMiddleware.cs:line 35\r\nClientConnectionId:XXX\r\nError Number:-2,State:0,Class:11", "Microsoft.Data.SqlClient.SqlException", "System.ComponentModel.Win32Exception")] + [InlineData(2, "Microsoft.Data.SqlClient.SqlException (0x80131904): Another Exception, SqlException. Another exception..... \r\n ---> System.ComponentModel.Win32Exception (258): Unknown error 258\r\n at Microsoft.Data.SqlClient.SqlCommand.<>c.b__195_0(Task`1 result)\r\n at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n--- End of stack trace from previous location ---\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)\r\n--- End of stack trace from previous location ---\r\n at Datadog.Trace.ClrProfiler.CallTarget.Handlers.Continuations.TaskContinuationGenerator`4.SyncCallbackHandler.ContinuationAction(Task`1 previousTask, TTarget target, CallTargetState state) in /project/tracer/src/Datadog.Trace/ClrProfiler/CallTarget/Handlers/Continuations/TaskContinuationGenerator`1.cs:line 140\r\n at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()\r\n at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)\r\n at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) in /builds/programmers/foo-api/Foo.Bar.Core/App/WorkOrders.cs:line 786\r\n at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) in /builds/programmers/foo-api/Foo.Bar.Core/App/WorkOrders.cs:line 500\r\n at Foo.Bar.Backend.Controllers.WorkOrdersController.GetStats(GetWorkOrderStatsRequestFooApi request) in /builds/programmers/foo-api/Foo.Bar.Backend/Controllers/WorkOrdersController.cs:line 138\r\n at lambda_method6365(Closure, Object)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/GetCompanyMiddleware.cs:line 61\r\n at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckRouteMiddleware.cs:line 28\r\n at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckAccessMiddleware.cs:line 57\r\n at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) in /project/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AspNetCore/BlockingMiddleware.cs:line 115\r\n at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/ErrorHandlingMiddleware.cs:line 35\r\nBLablalbalbClientConnectionId:XXX\r\nMessage Messag Message", "Microsoft.Data.SqlClient.SqlException", "System.ComponentModel.Win32Exception")] + [InlineData(3, "Microsoft.Data.SqlClient.SqlException (0x80131904): Another Exception, SqlException. Another exception..... \r\n ---> System.ComponentModel.Win32Exception (258): Unknown error 258\r\n at Microsoft.Data.SqlClient.SqlCommand.<>c.b__195_0(Task`1 result)\r\n at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n--- End of stack trace from previous location ---\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)\r\n--- End of stack trace from previous location ---\r\n at Datadog.Trace.ClrProfiler.CallTarget.Handlers.Continuations.TaskContinuationGenerator`4.SyncCallbackHandler.ContinuationAction(Task`1 previousTask, TTarget target, CallTargetState state) in /project/tracer/src/Datadog.Trace/ClrProfiler/CallTarget/Handlers/Continuations/TaskContinuationGenerator`1.cs:line 140\r\n at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()\r\n at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)\r\n at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) in /builds/programmers/foo-api/Foo.Bar.Core/App/WorkOrders.cs:line 786\r\n at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) in /builds/programmers/foo-api/Foo.Bar.Core/App/WorkOrders.cs:line 500\r\n at Foo.Bar.Backend.Controllers.WorkOrdersController.GetStats(GetWorkOrderStatsRequestFooApi request) in /builds/programmers/foo-api/Foo.Bar.Backend/Controllers/WorkOrdersController.cs:line 138\r\n at lambda_method6365(Closure, Object)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/GetCompanyMiddleware.cs:line 61\r\n at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckRouteMiddleware.cs:line 28\r\n at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckAccessMiddleware.cs:line 57\r\n at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) in /project/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AspNetCore/BlockingMiddleware.cs:line 115\r\n at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/ErrorHandlingMiddleware.cs:line 35\r\nBLablalbalbClientConnectionId:XXX\r\nMessage Messag Message", "Microsoft.Data.SqlClient.SqlException", null)] + [InlineData(4, "Microsoft.Data.SqlClient.SqlException (0x80131904): Another Exception, SqlException. Another exception..... \r\n ---> System.ComponentModel.Win32Exception (258): Unknown error 258\r\n at Microsoft.Data.SqlClient.SqlCommand.<>c.b__195_0(Task`1 result)\r\n at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n--- End of stack trace from previous location ---\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)\r\n--- End of stack trace from previous location ---\r\n at Datadog.Trace.ClrProfiler.CallTarget.Handlers.Continuations.TaskContinuationGenerator`4.SyncCallbackHandler.ContinuationAction(Task`1 previousTask, TTarget target, CallTargetState state) in /project/tracer/src/Datadog.Trace/ClrProfiler/CallTarget/Handlers/Continuations/TaskContinuationGenerator`1.cs:line 140\r\n at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()\r\n at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)\r\n at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) in /builds/programmers/foo-api/Foo.Bar.Core/App/WorkOrders.cs:line 786\r\n at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) in /builds/programmers/foo-api/Foo.Bar.Core/App/WorkOrders.cs:line 500\r\n at Foo.Bar.Backend.Controllers.WorkOrdersController.GetStats(GetWorkOrderStatsRequestFooApi request) in /builds/programmers/foo-api/Foo.Bar.Backend/Controllers/WorkOrdersController.cs:line 138\r\n at lambda_method6365(Closure, Object)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/GetCompanyMiddleware.cs:line 61\r\n at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckRouteMiddleware.cs:line 28\r\n at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckAccessMiddleware.cs:line 57\r\n at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) in /project/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AspNetCore/BlockingMiddleware.cs:line 115\r\n at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/ErrorHandlingMiddleware.cs:line 35\r\nBLablalbalbClientConnectionId:XXX\r\nMessage Messag Message", "Microsoft.Data.SqlClient.SqlException2", null)] + [InlineData(5, "Microsoft.Data.SqlClient.SqlException (BlaBlaBla): Another Exception, SqlException. Another exception..... \r\n ---> System.ComponentModel.Win32Exception (258): Unknown error 258\r\n at Microsoft.Data.SqlClient.SqlCommand.<>c.b__195_0(Task`1 result)\r\n at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n--- End of stack trace from previous location ---\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)\r\n--- End of stack trace from previous location ---\r\n at Datadog.Trace.ClrProfiler.CallTarget.Handlers.Continuations.TaskContinuationGenerator`4.SyncCallbackHandler.ContinuationAction(Task`1 previousTask, TTarget target, CallTargetState state) in /project/tracer/src/Datadog.Trace/ClrProfiler/CallTarget/Handlers/Continuations/TaskContinuationGenerator`1.cs:line 140\r\n at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()\r\n at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)\r\n at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) in /builds/programmers/foo-api/Foo.Bar.Core/App/WorkOrders.cs:line 786\r\n at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) in /builds/programmers/foo-api/Foo.Bar.Core/App/WorkOrders.cs:line 500\r\n at Foo.Bar.Backend.Controllers.WorkOrdersController.GetStats(GetWorkOrderStatsRequestFooApi request) in /builds/programmers/foo-api/Foo.Bar.Backend/Controllers/WorkOrdersController.cs:line 138\r\n at lambda_method6365(Closure, Object)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/GetCompanyMiddleware.cs:line 61\r\n at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckRouteMiddleware.cs:line 28\r\n at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckAccessMiddleware.cs:line 57\r\n at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) in /project/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AspNetCore/BlockingMiddleware.cs:line 115\r\n at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/ErrorHandlingMiddleware.cs:line 35\r\nBLablalbalbClientConnectionId:XXX\r\nMessage Messag Message", "Microsoft.Data.SqlClient.SqlException2", "System.ComponentModel.Win32Exception")] + [InlineData(6, "Microsoft.Data.SqlClient.SqlException (BlaBlaBla2): Another Exception, SqlException. Another exception..... \r\n ---> System.ComponentModel.Win32Exception (258): Unknown error 258\r\n at Microsoft.Data.SqlClient.SqlCommand.<>c.b__195_0(Task`1 result)\r\n at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n--- End of stack trace from previous location ---\r\n at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)\r\n--- End of stack trace from previous location ---\r\n at Datadog.Trace.ClrProfiler.CallTarget.Handlers.Continuations.TaskContinuationGenerator`4.SyncCallbackHandler.ContinuationAction(Task`1 previousTask, TTarget target, CallTargetState state) in /project/tracer/src/Datadog.Trace/ClrProfiler/CallTarget/Handlers/Continuations/TaskContinuationGenerator`1.cs:line 140\r\n at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()\r\n at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken)\r\n at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) in /builds/programmers/foo-api/Foo.Bar.Core/App/WorkOrders.cs:line 786\r\n at Foo.Bar.Core.App.WorkOrders.GetStats(Int32 associationId, Nullable`1 accountNumber, String unitNumber, String categoryName, List`1 associationIds) in /builds/programmers/foo-api/Foo.Bar.Core/App/WorkOrders.cs:line 500\r\n at Foo.Bar.Backend.Controllers.WorkOrdersController.GetStats(GetWorkOrderStatsRequestFooApi request) in /builds/programmers/foo-api/Foo.Bar.Backend/Controllers/WorkOrdersController.cs:line 138\r\n at lambda_method6365(Closure, Object)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/GetCompanyMiddleware.cs:line 61\r\n at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckRouteMiddleware.cs:line 28\r\n at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckAccessMiddleware.cs:line 57\r\n at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) in /project/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AspNetCore/BlockingMiddleware.cs:line 115\r\n at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/ErrorHandlingMiddleware.cs:line 35\r\nBLablalbalbClientConnectionId:XXX\r\nMessage Messag Message", "Microsoft.Data.SqlClient.SqlException2", null)] + [InlineData(7, "System.NullReferenceException: Object reference not set to an instance of an object.\r\n at MyApp.Services.UserService.GetUserById(Int32 id) in C:\\Projects\\MyApp\\Services\\UserService.cs:line 45\r\n at MyApp.Controllers.UserController.GetUser(Int32 id) in C:\\Projects\\MyApp\\Controllers\\UserController.cs:line 25\r\n at lambda_method(Closure , Object , Object[] )", "System.NullReferenceException", null)] + [InlineData(8, "System.InvalidOperationException: Operation is not valid due to the current state of the object.\r\n at MyApp.Data.DatabaseContext.SaveChanges() in /src/MyApp/Data/DatabaseContext.cs:line 120\r\n at MyApp.Services.UserService.CreateUser(User user) in /src/MyApp/Services/UserService.cs:line 75\r\n--- End of stack trace from previous location ---\r\n at MyApp.Services.UserService.CreateUser(User user) in /src/MyApp/Services/UserService.cs:line 100", "System.InvalidOperationException", null)] + [InlineData(9, "System.ArgumentNullException: Value cannot be null.\r\nParameter name: user\r\n at MyApp.Services.UserService.UpdateUser(User user) in D:\\Code\\MyApp\\Services\\UserService.cs:line 110\r\n at MyApp.Controllers.UserController.UpdateUser(User user) in D:\\Code\\MyApp\\Controllers\\UserController.cs:line 35", "System.ArgumentNullException", null)] + [InlineData(10, "System.FormatException: Input string was not in a correct format.\r\n at System.Number.StringToNumber(ReadOnlySpan`1 str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)\r\n at System.Number.ParseInt32(ReadOnlySpan`1 s, NumberStyles style, NumberFormatInfo info)\r\n at MyApp.Utilities.StringExtensions.ToInt32(String input) in /opt/myapp/src/Utilities/StringExtensions.cs:line 50", "System.FormatException", null)] + [InlineData(11, "System.AggregateException: One or more errors occurred.\r\n at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)\r\n at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location ---\r\n at MyApp.Controllers.UserController.CreateUserAsync(User user) in /src/MyApp/Controllers/UserController.cs:line 80\r\n ---> System.Net.Http.HttpRequestException: An error occurred while sending the request.\r\n at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)", "System.AggregateException", "System.Net.Http.HttpRequestException")] + [InlineData(12, "System.Exception: A general error occurred.\r\n at MyApp.Program.Main(String[] args) in /app/MyApp/Program.cs:line 10", "System.Exception", null)] + [InlineData(13, "System.IO.FileNotFoundException: Could not load file or assembly 'SomeLibrary'.\r\n at MyApp.Services.FileService.ReadFile(String path) in /home/user/MyApp/Services/FileService.cs:line 65", "System.IO.FileNotFoundException", null)] + [InlineData(14, "System.InvalidCastException: Unable to cast object of type 'System.String' to type 'System.Int32'.\r\n at MyApp.Models.User.set_Age(Object value) in /var/myapp/Models/User.cs:line 20", "System.InvalidCastException", null)] + [InlineData(15, "System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.\r\n at MyApp.Services.LargeDataProcessor.ProcessLargeData() in /mnt/data/MyApp/Services/LargeDataProcessor.cs:line 200", "System.OutOfMemoryException", null)] + [InlineData(16, "System.Threading.Tasks.TaskCanceledException: A task was canceled.\r\n at MyApp.Services.HttpService.GetDataAsync(String url) in /app/MyApp/Services/HttpService.cs:line 150\r\n at MyApp.Controllers.DataController.GetData(String id) in /app/MyApp/Controllers/DataController.cs:line 45", "System.Threading.Tasks.TaskCanceledException", null)] + [InlineData(17, "System.InvalidOperationException: The operation is invalid.\r\n at MyApp.Services.UserService.GetUserById(Int32 id) in C:\\Projects\\MyApp\\Services\\UserService.cs:line 50\r\n at MyApp.Controllers.UserController.GetUser(Int32 id) in C:\\Projects\\MyApp\\Controllers\\UserController.cs:line 30\r\n--- End of stack trace from previous location ---\r\n at MyApp.Middleware.LoggingMiddleware.Invoke(HttpContext context) in C:\\Projects\\MyApp\\Middleware\\LoggingMiddleware.cs:line 40\r\n ---> System.NullReferenceException: Object reference not set to an instance of an object.\r\n at MyApp.Services.UserService.FindUser(String name) in C:\\Projects\\MyApp\\Services\\UserService.cs:line 100", "System.InvalidOperationException", "System.NullReferenceException")] + [InlineData(18, "System.ArgumentException: The argument is invalid.\r\n at MyApp.Data.DatabaseContext.GetUserById(Int32 id) in /src/MyApp/Data/DatabaseContext.cs:line 120\r\n at MyApp.Services.UserService.CreateUser(User user) in /src/MyApp/Services/UserService.cs:line 85\r\n--- End of stack trace from previous location ---\r\n at MyApp.Controllers.UserController.CreateUser(User user) in /src/MyApp/Controllers/UserController.cs:line 45\r\n ---> System.InvalidOperationException: Cannot create user due to database state.\r\n at MyApp.Data.DatabaseContext.SaveChanges() in /src/MyApp/Data/DatabaseContext.cs:line 150", "System.ArgumentException", "System.InvalidOperationException")] + [InlineData(19, "System.FormatException: The format is incorrect.\r\n at System.Number.StringToNumber(ReadOnlySpan`1 str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)\r\n at System.Number.ParseInt32(ReadOnlySpan`1 s, NumberStyles style, NumberFormatInfo info)\r\n at MyApp.Utilities.StringExtensions.ToInt32(String input) in /opt/myapp/src/Utilities/StringExtensions.cs:line 70\r\n at MyApp.Controllers.DataController.ConvertStringToInt(String value) in /opt/myapp/src/Controllers/DataController.cs:line 50", "System.FormatException", null)] + [InlineData(20, "System.InvalidOperationException: Operation failed due to invalid state.\r\n at MyApp.Controllers.HomeController.Index() in D:\\Web\\MyApp\\Controllers\\HomeController.cs:line 30\r\n at Microsoft.AspNetCore.Mvc.ViewResultExecutor.Execute(ViewContext viewContext, String contentPath) in /home/user/.dotnet/sdk/NuGetFallbackFolder/microsoft.aspnetcore.mvc.viewfeatures/2.1.1/lib/netstandard2.0/Microsoft.AspNetCore.Mvc.ViewFeatures.dll:line 100\r\n ---> System.Data.SqlClient.SqlException: Timeout expired.\r\n at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) in /_/src/Microsoft.Data.SqlClient.SqlClient/SqlConnection.cs:line 750", "System.InvalidOperationException", "System.Data.SqlClient.SqlException")] + [InlineData(21, "System.AggregateException: One or more errors occurred.\r\n at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)\r\n at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location ---\r\n at MyApp.Controllers.FileController.UploadFileAsync(IFormFile file) in /src/MyApp/Controllers/FileController.cs:line 60\r\n ---> System.IO.IOException: The file cannot be accessed.\r\n at MyApp.Services.FileService.SaveFile(String path, IFormFile file) in /src/MyApp/Services/FileService.cs:line 90", "System.AggregateException", "System.IO.IOException")] + [InlineData(22, "System.NullReferenceException: Object reference not set to an instance of an object.\r\n at MyApp.Services.CustomerService.GetCustomerDetails(Int32 customerId) in C:\\Code\\MyApp\\Services\\CustomerService.cs:line 100\r\n at MyApp.Controllers.CustomerController.GetCustomer(Int32 id) in C:\\Code\\MyApp\\Controllers\\CustomerController.cs:line 50", "System.NullReferenceException", null)] + [InlineData(23, "System.InvalidOperationException: Invalid operation attempted.\r\n at MyApp.Services.OrderService.ProcessOrder(Int32 orderId) in /home/user/MyApp/Services/OrderService.cs:line 120\r\n at MyApp.Controllers.OrderController.CompleteOrder(Int32 id) in /home/user/MyApp/Controllers/OrderController.cs:line 60\r\n--- End of stack trace from previous location ---\r\n at MyApp.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) in /home/user/MyApp/Middleware/ErrorHandlingMiddleware.cs:line 40\r\n ---> System.NullReferenceException: Object reference not set to an instance of an object.\r\n at MyApp.Services.OrderService.ValidateOrder(Order order) in /home/user/MyApp/Services/OrderService.cs:line 200", "System.InvalidOperationException", "System.NullReferenceException")] + [InlineData(24, "System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: index\r\n at MyApp.Collections.CustomList`1.get_Item(Int32 index) in /mnt/data/MyApp/Collections/CustomList.cs:line 80\r\n at MyApp.Controllers.CollectionController.GetItem(Int32 index) in /mnt/data/MyApp/Controllers/CollectionController.cs:line 45", "System.ArgumentOutOfRangeException", null)] + [InlineData(25, "System.InvalidOperationException: The operation failed.\r\n at MyApp.Services.UserService.GetUserById(Int32 id) in C:\\Projects\\MyApp\\Services\\UserService.cs:line 45\r\n at MyApp.Controllers.UserController.GetUser(Int32 id) in C:\\Projects\\MyApp\\Controllers\\UserController.cs:line 25\r\n--- End of stack trace from previous location ---\r\n at MyApp.Middleware.LoggingMiddleware.Invoke(HttpContext context) in C:\\Projects\\MyApp\\Middleware\\LoggingMiddleware.cs:line 35\r\n ---> System.NullReferenceException: Object reference not set to an instance of an object.\r\n at MyApp.Services.UserService.FindUser(String name) in C:\\Projects\\MyApp\\Services\\UserService.cs:line 95", "System.InvalidOperationException", "System.NullReferenceException")] + [InlineData(26, "System.ArgumentException: Invalid argument.\r\n at MyApp.Services.ValidationService.Validate(Object value) in D:\\Projects\\MyApp\\Services\\ValidationService.cs:line 55\r\n at MyApp.Controllers.ValidationController.ValidateInput(Object input) in D:\\Projects\\MyApp\\Controllers\\ValidationController.cs:line 35\r\n--- End of stack trace from previous location ---\r\n at MyApp.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) in D:\\Projects\\MyApp\\Middleware\\ErrorHandlingMiddleware.cs:line 45\r\n ---> System.NullReferenceException: Value cannot be null.\r\n at MyApp.Services.ValidationService.CheckNull(Object value) in D:\\Projects\\MyApp\\Services\\ValidationService.cs:line 75", "System.ArgumentException", "System.NullReferenceException")] + [InlineData(27, "System.InvalidOperationException: Cannot execute operation.\r\n at MyApp.Data.DbContext.ExecuteCommand(String command) in /var/www/MyApp/Data/DbContext.cs:line 90\r\n at MyApp.Services.CommandService.RunCommand(String command) in /var/www/MyApp/Services/CommandService.cs:line 40\r\n--- End of stack trace from previous location ---\r\n at MyApp.Controllers.CommandController.ExecuteCommand(String command) in /var/www/MyApp/Controllers/CommandController.cs:line 30\r\n ---> System.Data.SqlClient.SqlException: SQL execution failed.\r\n at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() in /_/src/Microsoft.Data.SqlClient.SqlCommand.cs:line 500", "System.InvalidOperationException", "System.Data.SqlClient.SqlException")] + [InlineData(28, "Foo.Bar.Models.Exceptions.FOOException: The invoice number already exists\r\n at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.ValidateTransactions() in /builds/programmers/foo-api/Foo.Bar.Core/Core/Transactions/PayableInvoiceTransaction.cs:line 267\r\n at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.CreatePayableInvoice() in /builds/programmers/foo-api/Foo.Bar.Core/Core/Transactions/PayableInvoiceTransaction.cs:line 40\r\n at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.CreatePayableInvoice() in /builds/programmers/foo-api/Foo.Bar.Core/Core/Transactions/PayableInvoiceTransaction.cs:line 87\r\n at Foo.Bar.Core.App.Transactions.<>c__DisplayClass17_0.<b__1>d.MoveNext() in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 571\r\n--- End of stack trace from previous location ---\r\n at Foo.Bar.Core.App.Transactions.<>c__DisplayClass17_0.<b__1>d.MoveNext() in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 572\r\n--- End of stack trace from previous location ---\r\n at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c.<b__3_0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)\r\n at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 574\r\n at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 574\r\n at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 575\r\n at Foo.Bar.Backend.Controllers.TransactionsController.CreatePayableWithFiles(PayableRequest request) in /builds/programmers/foo-api/Foo.Bar.Backend/Controllers/TransactionsController.cs:line 53\r\n at lambda_method7658(Closure, Object)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/GetCompanyMiddleware.cs:line 61\r\n at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckRouteMiddleware.cs:line 28\r\n at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckAccessMiddleware.cs:line 56\r\n at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) in /project/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AspNetCore/BlockingMiddleware.cs:line 115\r\n at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/ErrorHandlingMiddleware.cs:line 35", "Foo.Bar.Models.Exceptions.FOOException", null)] + [InlineData(29, "Foo.Bar.Models.Exceptions.FOOException: The XXX has payments. It cannot be modified\r\n at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.ValidateTransactions() in /builds/programmers/foo-api/Foo.Bar.Core/Core/Transactions/PayableInvoiceTransaction.cs:line 268\r\n at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.EditPayableInvoice() in /builds/programmers/foo-api/Foo.Bar.Core/Core/Transactions/PayableInvoiceTransaction.cs:line 105\r\n at Foo.Bar.Core.App.Transactions.<>c__DisplayClass17_0.<b__1>d.MoveNext() in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 571\r\n--- End of stack trace from previous location ---\r\n at Foo.Bar.Core.App.Transactions.<>c__DisplayClass17_0.<b__1>d.MoveNext() in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 572\r\n--- End of stack trace from previous location ---\r\n at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c.<b__3_0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)\r\n at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 574\r\n at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 574\r\n at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 575\r\n at Foo.Bar.Backend.Controllers.TransactionsController.EditPayableWithFiles(PayableRequest request) in /builds/programmers/foo-api/Foo.Bar.Backend/Controllers/TransactionsController.cs:line 104\r\n at lambda_method11253(Closure, Object)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/GetCompanyMiddleware.cs:line 61\r\n at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckRouteMiddleware.cs:line 28\r\n at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckAccessMiddleware.cs:line 56\r\n at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) in /project/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AspNetCore/BlockingMiddleware.cs:line 115\r\n at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/ErrorHandlingMiddleware.cs:line 35", "Foo.Bar.Models.Exceptions.FOOException", null)] + [InlineData(30, "Foo.Bar.Models.Exceptions.FOOException: The transaction is outside of the financial year.\r\n at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.ValidateTransactions() in /builds/programmers/foo-api/Foo.Bar.Core/Core/Transactions/PayableInvoiceTransaction.cs:line 266\r\n at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.CreatePayableInvoice() in /builds/programmers/foo-api/Foo.Bar.Core/Core/Transactions/PayableInvoiceTransaction.cs:line 38\r\n at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.CreatePayableInvoice() in /builds/programmers/foo-api/Foo.Bar.Core/Core/Transactions/PayableInvoiceTransaction.cs:line 87\r\n at Foo.Bar.Core.App.Transactions.<>c__DisplayClass17_0.<b__1>d.MoveNext() in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 571\r\n--- End of stack trace from previous location ---\r\n at Foo.Bar.Core.App.Transactions.<>c__DisplayClass17_0.<b__1>d.MoveNext() in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 572\r\n--- End of stack trace from previous location ---\r\n at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c.<b__3_0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)\r\n at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 574\r\n at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 574\r\n at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 575\r\n at Foo.Bar.Backend.Controllers.TransactionsController.CreatePayableWithFiles(PayableRequest request) in /builds/programmers/foo-api/Foo.Bar.Backend/Controllers/TransactionsController.cs:line 53\r\n at lambda_method9440(Closure, Object)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/GetCompanyMiddleware.cs:line 61\r\n at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckRouteMiddleware.cs:line 28\r\n at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckAccessMiddleware.cs:line 56\r\n at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) in /project/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AspNetCore/BlockingMiddleware.cs:line 115\r\n at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/ErrorHandlingMiddleware.cs:line 35", "Foo.Bar.Models.Exceptions.FOOException", null)] + [InlineData(31, "Foo.Bar.Models.Exceptions.FOOException: The YYY has payments. It cannot be modified\r\n at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.ValidateTransactions() in /builds/programmers/foo-api/Foo.Bar.Core/Core/Transactions/PayableInvoiceTransaction.cs:line 268\r\n at Foo.Bar.Core.Core.Transactions.PayableInvoiceTransaction.EditPayableInvoice() in /builds/programmers/foo-api/Foo.Bar.Core/Core/Transactions/PayableInvoiceTransaction.cs:line 105\r\n at Foo.Bar.Core.App.Transactions.<>c__DisplayClass17_0.<b__1>d.MoveNext() in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 571\r\n--- End of stack trace from previous location ---\r\n at Foo.Bar.Core.App.Transactions.<>c__DisplayClass17_0.<b__1>d.MoveNext() in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 572\r\n--- End of stack trace from previous location ---\r\n at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.<>c.<b__3_0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.<>c__DisplayClass30_0`2.<b__0>d.MoveNext()\r\n--- End of stack trace from previous location ---\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementationAsync[TState,TResult](Func`4 operation, Func`4 verifySucceeded, TState state, CancellationToken cancellationToken)\r\n at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)\r\n at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 574\r\n at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 574\r\n at Foo.Bar.Core.App.Transactions.CreatePayableInvoice(PayableRequest request, Boolean isEdit) in /builds/programmers/foo-api/Foo.Bar.Core/App/Transactions.cs:line 575\r\n at Foo.Bar.Backend.Controllers.TransactionsController.EditPayableWithFiles(PayableRequest request) in /builds/programmers/foo-api/Foo.Bar.Backend/Controllers/TransactionsController.cs:line 104\r\n at lambda_method11253(Closure, Object)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)\r\n at Foo.Bar.Backend.Middleware.GetCompanyMiddleware.Invoke(HttpContext httpContext, ISessionCache sessionCache, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/GetCompanyMiddleware.cs:line 61\r\n at Foo.Bar.Backend.Middleware.CheckRouteMiddleware.Invoke(HttpContext context, IApiFunctions api) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckRouteMiddleware.cs:line 28\r\n at Foo.Bar.Backend.Middleware.CheckAccessMiddleware.Invoke(HttpContext context, IApiFunctions api, IConfiguration config) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/CheckAccessMiddleware.cs:line 56\r\n at Datadog.Trace.ClrProfiler.AutoInstrumentation.AspNetCore.BlockingMiddleware.Invoke(HttpContext context) in /project/tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AspNetCore/BlockingMiddleware.cs:line 115\r\n at Foo.Bar.Backend.Middleware.ErrorHandlingMiddleware.Invoke(HttpContext context) in /builds/programmers/foo-api/Foo.Bar.Backend/Middleware/ErrorHandlingMiddleware.cs:line 35", "Foo.Bar.Models.Exceptions.FOOException", null)] + public async Task HashExceptionToStringTest(int index, string exceptionToString, string outerExceptionType, string? innerExceptionType) + { + var exceptionNormalizer = new TestExceptionNormalizer(); + var debug = new StringBuilder(); + + var stopWatch = Stopwatch.StartNew(); + var hash = exceptionNormalizer.NormalizeAndHashException(exceptionToString, outerExceptionType, innerExceptionType, debug); + stopWatch.Stop(); + + var elapsedMicroseconds = stopWatch.ElapsedTicks * (1000000.0 / Stopwatch.Frequency); + _testOutputHelper.WriteLine($"Execution Time: {stopWatch.ElapsedMilliseconds} ms. Microseconds: {elapsedMicroseconds} µs"); + + debug.AppendLine("Resulting Hash: " + hash); + + var settings = new VerifySettings(); + settings.UseFileName($"{nameof(ExceptionNormalizerTests)}.{index}"); + await Verifier.Verify(debug.ToString(), settings); + } + } +}