Hi, I am sorry for being late, I think these decorators you provide are super useful, but I have a little problem when I use the timeout decorator, if the method throw an error before timeout, I cannot catch the original error but timeout error.
Example code:
const ms = 50;
class T {
@timeout(ms)
async foo() {
await Promise.reject(1);
await sleep(100);
}
}
const t = new T();
try {
await t.foo();
} catch (e) {
console.log(e);
}
Current output : [Error: timeout occurred after 50]
Expect output : 1
Hi, I am sorry for being late, I think these decorators you provide are super useful, but I have a little problem when I use the timeout decorator, if the method throw an error before timeout, I cannot catch the original error but timeout error.
Example code:
Current output : [Error: timeout occurred after 50] Expect output : 1
Linked pull request: #142