mirror of https://github.com/nodejs/node.git
Throw ret value from wait() only if it's there.
parent
389c80aece
commit
3311122ccb
|
@ -51,7 +51,13 @@ node.Promise.prototype.wait = function () {
|
|||
})
|
||||
.block();
|
||||
|
||||
if (had_error) throw ret;
|
||||
if (had_error) {
|
||||
if (ret) {
|
||||
throw ret;
|
||||
} else {
|
||||
throw new Error("Promise completed with error (No arguments given.)");
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue