Skip to content

Commit 9ab3627

Browse files
author
Luca Forstner
committed
Feedback
1 parent aabd1a9 commit 9ab3627

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

packages/core/src/server-runtime-client.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,13 +212,11 @@ function setCurrentRequestSessionErroredOrCrashed(eventHint?: EventHint): void {
212212
// isolationScope. If that isolation scope is forked, setting the processing metadata here will not mutate the
213213
// original isolation scope that the http integration stored away.
214214
const isHandledException = eventHint?.mechanism?.handled ?? true;
215-
if (isHandledException) {
216-
// A request session can go from "errored" -> "crashed" but not "crashed" -> "errored".
217-
// Crashed (unhandled exception) is worse than errored (handled exception).
218-
if (requestSession.status !== 'crashed') {
219-
requestSession.status = 'errored';
220-
}
221-
} else {
215+
// A request session can go from "errored" -> "crashed" but not "crashed" -> "errored".
216+
// Crashed (unhandled exception) is worse than errored (handled exception).
217+
if (isHandledException && requestSession.status !== 'crashed') {
218+
requestSession.status = 'errored';
219+
} else if (!isHandledException) {
222220
requestSession.status = 'crashed';
223221
}
224222
}

0 commit comments

Comments
 (0)