Skip to content

Commit fb450a7

Browse files
guguMarsup
authored andcommitted
keep stacktrace in timed function
1 parent a27f7e0 commit fb450a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/toolkit.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ exports.Manager = class {
135135
};
136136

137137

138-
exports.timed = function (method, options) {
138+
exports.timed = async function (method, options) {
139139

140140
if (!options.timeout) {
141141
return method;
@@ -151,7 +151,7 @@ exports.timed = function (method, options) {
151151
setTimeout(handler, options.timeout);
152152
});
153153

154-
return Promise.race([timer, method]);
154+
return await Promise.race([timer, method]);
155155
};
156156

157157

0 commit comments

Comments
 (0)