Skip to content

Commit

Permalink
keep stacktrace in timed function
Browse files Browse the repository at this point in the history
  • Loading branch information
gugu authored and Marsup committed Jan 29, 2024
1 parent a27f7e0 commit fb450a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/toolkit.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ exports.Manager = class {
};


exports.timed = function (method, options) {
exports.timed = async function (method, options) {

if (!options.timeout) {
return method;
Expand All @@ -151,7 +151,7 @@ exports.timed = function (method, options) {
setTimeout(handler, options.timeout);
});

return Promise.race([timer, method]);
return await Promise.race([timer, method]);
};


Expand Down

0 comments on commit fb450a7

Please sign in to comment.