mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 06:50:01 -04:00
error.stack
This commit is contained in:
parent
65045d5aab
commit
b47f19ac60
1 changed files with 18 additions and 0 deletions
18
src/client/shared/error.ts
Normal file
18
src/client/shared/error.ts
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import { decodeUrl } from "../../shared";
|
||||||
|
import { ScramjetClient } from "../client";
|
||||||
|
|
||||||
|
export default function (client: ScramjetClient, self: Self) {
|
||||||
|
// v8 only. all we need to do is clean the scramjet urls from stack traces
|
||||||
|
Error.prepareStackTrace = (error, stack) => {
|
||||||
|
let newstack = error.stack;
|
||||||
|
|
||||||
|
for (let i = 0; i < stack.length; i++) {
|
||||||
|
const url = stack[i].getFileName();
|
||||||
|
try {
|
||||||
|
newstack = newstack.replaceAll(url, decodeUrl(url));
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
return newstack;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue