Skip to content

Commit

Permalink
Fixed again RESTBuilder.promise().
Browse files Browse the repository at this point in the history
  • Loading branch information
petersirka committed Dec 27, 2024
1 parent b419ab1 commit b4bedf9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions builders.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ Options.prototype.promisify = function(fn, a, b, c) {

var callback = function(err, response) {
if (err)

$.invalid(err);
else
resolve(response);
Expand Down Expand Up @@ -1050,8 +1051,12 @@ function restbuilder_callback(err, response) {

if (self.$resolve) {

if (err)
self.$.invalid(err);
if (err) {
if (self.$)
self.$.invalid(err);
else
self.$reject(err);
}
else
self.$resolve(val);

Expand Down

0 comments on commit b4bedf9

Please sign in to comment.