Skip to content

Commit

Permalink
only grab the first 8 lines of the component stack
Browse files Browse the repository at this point in the history
  • Loading branch information
AAGaming00 committed Aug 20, 2024
1 parent e5e75cc commit 7c9b68c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/utils/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export function getLikelyErrorSourceFromValveError(error: ValveError): ErrorSour
}

export function getLikelyErrorSourceFromValveReactError(error: ValveReactErrorInfo): ErrorSource {
return getLikelyErrorSource(error?.error?.stack + '\n' + error.info.componentStack);
// get the first 10 lines of the componentStack to avoid matching against the decky router wrapper for any route errors deeper in the tree
return getLikelyErrorSource(error?.error?.stack + '\n' + error.info.componentStack?.split("\n").slice(0, 8).join("\n"));
}

export function getLikelyErrorSource(error?: string): ErrorSource {
Expand Down

0 comments on commit 7c9b68c

Please sign in to comment.