only grab the first 8 lines of the component stack

This commit is contained in:
AAGaming
2024-08-20 14:55:59 -04:00
parent e5e75cc16e
commit 7c9b68c1dd
+2 -1
View File
@@ -22,7 +22,8 @@ export function getLikelyErrorSourceFromValveError(error: ValveError): ErrorSour
} }
export function getLikelyErrorSourceFromValveReactError(error: ValveReactErrorInfo): ErrorSource { 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 { export function getLikelyErrorSource(error?: string): ErrorSource {