Skip to content

Commit ea7b1b5

Browse files
committed
Addressed PR comment
1 parent 36e78e0 commit ea7b1b5

File tree

1 file changed

+9
-22
lines changed

1 file changed

+9
-22
lines changed

tracer/src/Datadog.Trace/Debugger/ExceptionAutoInstrumentation/ExceptionTrackManager.cs

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -762,28 +762,15 @@ private static void SetDiagnosticTag(Span span, string exceptionPhase, int excep
762762
return;
763763
}
764764

765-
var noCaptureReason = string.Empty;
766-
767-
switch (exceptionPhase)
768-
{
769-
case ExceptionReplayDiagnosticTagNames.Eligible:
770-
break;
771-
case ExceptionReplayDiagnosticTagNames.NoCustomerFrames or ExceptionReplayDiagnosticTagNames.NoFramesToInstrument:
772-
noCaptureReason = NoCaptureReason.OnlyThirdPartyCode;
773-
break;
774-
case ExceptionReplayDiagnosticTagNames.InvalidatedCase or ExceptionReplayDiagnosticTagNames.InvalidatedExceptionCase:
775-
noCaptureReason = NoCaptureReason.InstrumentationFailure;
776-
break;
777-
case ExceptionReplayDiagnosticTagNames.NonSupportedExceptionType:
778-
noCaptureReason = NoCaptureReason.NonSupportedExceptionType;
779-
break;
780-
case ExceptionReplayDiagnosticTagNames.NotEligible or ExceptionReplayDiagnosticTagNames.NewCase:
781-
noCaptureReason = NoCaptureReason.FirstOccurrence;
782-
break;
783-
default:
784-
noCaptureReason = NoCaptureReason.GeneralError;
785-
break;
786-
}
765+
var noCaptureReason = exceptionPhase switch
766+
{
767+
ExceptionReplayDiagnosticTagNames.Eligible => string.Empty,
768+
ExceptionReplayDiagnosticTagNames.NoCustomerFrames or ExceptionReplayDiagnosticTagNames.NoFramesToInstrument => NoCaptureReason.OnlyThirdPartyCode,
769+
ExceptionReplayDiagnosticTagNames.InvalidatedCase or ExceptionReplayDiagnosticTagNames.InvalidatedExceptionCase => NoCaptureReason.InstrumentationFailure,
770+
ExceptionReplayDiagnosticTagNames.NonSupportedExceptionType => NoCaptureReason.NonSupportedExceptionType,
771+
ExceptionReplayDiagnosticTagNames.NotEligible or ExceptionReplayDiagnosticTagNames.NewCase => NoCaptureReason.FirstOccurrence,
772+
_ => NoCaptureReason.GeneralError,
773+
};
787774

788775
if (noCaptureReason != string.Empty)
789776
{

0 commit comments

Comments
 (0)