Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Commit

Permalink
remove error function in proto
Browse files Browse the repository at this point in the history
  • Loading branch information
fschoenfelder committed Jul 2, 2014
1 parent 635322f commit 4f91a9e
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/proto.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ exports.save = function(fn){
.send(self)
.end(function(err, res){
if (err || res.error)
return fn(error(err,res), res);
return fn(self.error(err,res), res);

if (res.body) self.primary(res.body[key]);
self.dirty = {};
Expand Down Expand Up @@ -299,8 +299,3 @@ exports.toJSON = function(){
* @api private
*/

function error(err, res) {
if (err) return err;
else return new Error('got ' + res.status + ' response');
}
exports.error = error;

0 comments on commit 4f91a9e

Please sign in to comment.