Skip to content

Commit

Permalink
Remove the throw for 500 errors from servers. Resolves flatiron#136. …
Browse files Browse the repository at this point in the history
…Test pass.
  • Loading branch information
xjamundx committed Mar 8, 2013
1 parent de93f1e commit 715a97a
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions lib/resourceful/resource.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,12 @@ Resource._request = function (/* method, [id, obj], callback */) {
var Factory;

if (e) {
if (e.status >= 500) {
throw new(Error)(e);
} else {
that.runAfterHooks(method, e, obj, function () {
that.emit("error", e, obj);
if (callback) {
callback(e);
}
});
}
that.runAfterHooks(method, e, obj, function () {
that.emit("error", e, obj);
if (callback) {
callback(e);
}
});
} else {
if (Array.isArray(result)) {
result = result.map(function (r) {
Expand Down

0 comments on commit 715a97a

Please sign in to comment.