fix(browser): remove catch-block originalJson reference (block-scoped to try)

originalJson is const inside the try block and not accessible from the
catch block (tsgo correctly flags this, tsc was lenient). The inner
try/catch around params.run() already restores res.json before
re-throwing, so the outer catch doesn't need the restore.

Fixes tsgo TS2304 in CI.
This commit is contained in:
zeroaltitude 2026-03-03 22:12:02 -07:00
parent c3d3732daa
commit 450ed33f94
No known key found for this signature in database
GPG Key ID: 77592FB1C703882E

View File

@ -191,10 +191,6 @@ export async function withRouteTabContext<T>(
return result;
} catch (err) {
// Ensure res.json is always restored for error handling.
if (params.res.json !== originalJson) {
params.res.json = originalJson;
}
handleRouteError(params.ctx, params.res, err);
return undefined;
}