cleanerrors flag

This commit is contained in:
velzie 2024-09-19 20:23:18 -04:00
parent f48ecdb2b9
commit 1474f76337
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F
3 changed files with 4 additions and 1 deletions

View file

@ -1,6 +1,7 @@
import { decodeUrl } from "../../shared"; import { decodeUrl } from "../../shared";
import { ScramjetClient } from "../client"; import { ScramjetClient } from "../client";
export const enabled = () => self.$scramjet.config.flags.cleanerrors;
export default function (client: ScramjetClient, self: Self) { export default function (client: ScramjetClient, self: Self) {
// v8 only. all we need to do is clean the scramjet urls from stack traces // v8 only. all we need to do is clean the scramjet urls from stack traces
Error.prepareStackTrace = (error, stack) => { Error.prepareStackTrace = (error, stack) => {

View file

@ -30,7 +30,8 @@ export class ScramjetController {
flags: { flags: {
serviceworkers: false, serviceworkers: false,
naiiveRewriter: false, naiiveRewriter: false,
captureErrors: false, captureErrors: true,
cleanerrors: false,
sourcemaps: false, sourcemaps: false,
}, },
}; };

1
src/types.d.ts vendored
View file

@ -23,6 +23,7 @@ type ScramjetFlags = {
serviceworkers: boolean; serviceworkers: boolean;
naiiveRewriter: boolean; naiiveRewriter: boolean;
captureErrors: boolean; captureErrors: boolean;
cleanerrors: boolean;
sourcemaps: boolean; sourcemaps: boolean;
}; };