Skip to content

Commit

Permalink
Update error.push() by adding status code.
Browse files Browse the repository at this point in the history
  • Loading branch information
petersirka committed Nov 22, 2017
1 parent ca9452c commit cf1cedf
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions builders.js
Original file line number Diff line number Diff line change
Expand Up @@ -2894,6 +2894,15 @@ ErrorBuilder.prototype.push = function(name, error, path, index, prefix) {
if (error === null || (!name && !error))
return this;

// Status code
if (error > 0) {
this.status = error;
error = '@';
} else if (path > 0) {
this.status = path;
path = undefined;
}

if (!error)
error = '@';

Expand Down

0 comments on commit cf1cedf

Please sign in to comment.