diff options
| author | AAGaming <aagaming@riseup.net> | 2024-06-14 20:20:15 -0400 |
|---|---|---|
| committer | AAGaming <aagaming@riseup.net> | 2024-06-14 20:20:15 -0400 |
| commit | 61ad88db77ddda56d956ee9bd522e2fccb253650 (patch) | |
| tree | 718cd200765a7670c3c030728966455629cb3198 | |
| parent | 84577c8708a249f1f4bdab88ac6d11c4eaea652d (diff) | |
| download | decky-loader-61ad88db77ddda56d956ee9bd522e2fccb253650.tar.gz decky-loader-61ad88db77ddda56d956ee9bd522e2fccb253650.zip | |
add doNotReportErrors
| -rw-r--r-- | frontend/src/errorboundary-hook.tsx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/frontend/src/errorboundary-hook.tsx b/frontend/src/errorboundary-hook.tsx index e49a705e..535c6135 100644 --- a/frontend/src/errorboundary-hook.tsx +++ b/frontend/src/errorboundary-hook.tsx @@ -13,6 +13,7 @@ declare global { class ErrorBoundaryHook extends Logger { private errorBoundaryPatch?: Patch; private errorCheckPatch?: Patch; + public doNotReportErrors: boolean = false; constructor() { super('ErrorBoundaryHook'); @@ -48,7 +49,7 @@ class ErrorBoundaryHook extends Logger { const react15069WorkaroundRegex = / at .+\.componentDidCatch\..+\.callback /; this.errorCheckPatch = replacePatch(Object.getPrototypeOf(errorReportingStore), 'BIsBlacklisted', (args: any[]) => { const [errorSource, wasPlugin, shouldReport] = getLikelyErrorSourceFromValveError(args[0]); - this.debug('Caught an error', args, { errorSource, wasPlugin, shouldReport }); + this.debug('Caught an error', args, { errorSource, wasPlugin, shouldReport, skipAllReporting: this.doNotReportErrors }); // react#15069 workaround. this took 2 hours to figure out. if ( args[0]?.message?.[3]?.[0] && @@ -58,6 +59,7 @@ class ErrorBoundaryHook extends Logger { this.debug('ignoring early report caused by react#15069'); return true; } + if (this.doNotReportErrors) return true; return shouldReport ? callOriginal : true; }); |
