mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 15:00:01 -04:00
catch promise rejections
This commit is contained in:
parent
696c9b3092
commit
df55dc9fc6
1 changed files with 11 additions and 0 deletions
|
@ -97,4 +97,15 @@ export default function (client: ScramjetClient, self: typeof globalThis) {
|
||||||
argdbg(t);
|
argdbg(t);
|
||||||
return t;
|
return t;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
client.Proxy("Promise.prototype.catch", {
|
||||||
|
apply(ctx) {
|
||||||
|
ctx.args[0] = new Proxy(ctx.args[0], {
|
||||||
|
apply(target, thisArg, argArray) {
|
||||||
|
console.warn("CAUGHT PROMISE REJECTION", argArray);
|
||||||
|
Reflect.apply(target, thisArg, argArray);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue