-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Update session status to 'unhandled' and extend SessionStatus type #17849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
d4c29f4
b2c5600
87f9ab7
540fcf8
8ae61ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -225,10 +225,16 @@ function setCurrentRequestSessionErroredOrCrashed(eventHint?: EventHint): void { | |
const isHandledException = eventHint?.mechanism?.handled ?? true; | ||
// A request session can go from "errored" -> "crashed" but not "crashed" -> "errored". | ||
// Crashed (unhandled exception) is worse than errored (handled exception). | ||
if (isHandledException && requestSession.status !== 'crashed') { | ||
requestSession.status = 'errored'; | ||
} else if (!isHandledException) { | ||
requestSession.status = 'crashed'; | ||
if (isHandledException) { | ||
// If it's a handled exception, we can only downgrade from 'ok' to 'errored'. | ||
// We should not downgrade from 'unhandled' or 'crashed'. | ||
if (requestSession.status === 'ok') { | ||
requestSession.status = 'errored'; | ||
} | ||
} else { | ||
// If it's an unhandled exception, we always set the status to 'unhandled'. | ||
// 'unhandled' is the most severe status. | ||
requestSession.status = 'unhandled'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Session Status Update Logic ChangedThe new logic for handled exceptions only updates session status from 'ok' to 'errored', changing previous behavior where 'abnormal' sessions would also transition. Additionally, unhandled exceptions now set the status to 'unhandled', making the existing comment referencing 'crashed' inaccurate. |
||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ export interface Session { | |
|
||
export type SessionContext = Partial<Session>; | ||
|
||
export type SessionStatus = 'ok' | 'exited' | 'crashed' | 'abnormal'; | ||
export type SessionStatus = 'ok' | 'exited' | 'crashed' | 'abnormal' | 'unhandled'; | ||
|
||
/** JSDoc */ | ||
export interface SessionAggregates { | ||
Comment on lines
30
to
36
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potential bug: The new
|
||
|
Uh oh!
There was an error while loading. Please reload this page.