Skip to content

Commit

Permalink
Merge pull request #39 from dhritzkiv/fix-errors
Browse files Browse the repository at this point in the history
Fix missing statusText and status code
  • Loading branch information
wraithgar committed Jan 25, 2016
2 parents 31db9fc + 1fc6927 commit 462ab75
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ampersand-collection-rest-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,12 @@ module.exports = {
var error = options.error;
options.error = function (collection, resp) {
delete model.collection;

if (error) error(collection, resp, options);

if (cb) {
var err = new Error(resp.statusText);
err.status = resp.status;
var err = new Error(resp.rawRequest.statusText);
err.status = resp.rawRequest.status;
cb(err);
}
};
Expand Down

0 comments on commit 462ab75

Please sign in to comment.