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:
parent
c3d3732daa
commit
450ed33f94
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user