Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be mistaken but shouldn't the rejection.stack unwinding be done optimally before the final JSON.stringify((rejection: $FlowFixMe))?

Copy link
Contributor Author

@ospfranco ospfranco Dec 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I don't think so, stringify does not unwind the stack or show it in the logbox . The stringify call is only for extracting a message.

Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ let rejectionTrackingOptions: $NonMaybeType<Parameters<enable>[0]> = {
? rejection
: JSON.stringify((rejection: $FlowFixMe));
}
// It could although this object is not a standard error, it still has stack information to unwind
// $FlowFixMe ignore types just check if stack is there
if (rejection.stack && typeof rejection.stack === 'string') {
stack = rejection.stack;
}
}

const warning = `Possible unhandled promise rejection (id: ${id}):\n${
Expand Down