Skip to content

Commit

Permalink
fix: Stacktraces not reversing when error has full context (#513)
Browse files Browse the repository at this point in the history
Fixes #489.
  • Loading branch information
BYK committed Sep 2, 2024
1 parent e41f7c3 commit 365ab8a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/stale-jobs-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@spotlightjs/overlay': patch
---

Fix stacktraces are not reversed sometimes (appearing in wrong order)
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,17 @@ class SentryDataCache {

return Promise.all(
(errorEvent.exception.values ?? []).map(async exception => {
if (!exception.stacktrace) {
return;
}
exception.stacktrace.frames.reverse();

if (
!exception.stacktrace ||
exception.stacktrace.frames?.every(frame => frame.post_context && frame.pre_context && frame.context_line)
) {
log('Skipping contextlines request for', exception);
log('Skipping contextlines request as we have full context for', exception);
return;
}
exception.stacktrace.frames.reverse();

try {
const makeFetch = getNativeFetchImplementation();
Expand Down

0 comments on commit 365ab8a

Please sign in to comment.