Skip to content

Commit 715a97a

Browse files
committed
Remove the throw for 500 errors from servers. Resolves flatiron#136. Test pass.
1 parent de93f1e commit 715a97a

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

lib/resourceful/resource.js

+6-10
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,12 @@ Resource._request = function (/* method, [id, obj], callback */) {
136136
var Factory;
137137

138138
if (e) {
139-
if (e.status >= 500) {
140-
throw new(Error)(e);
141-
} else {
142-
that.runAfterHooks(method, e, obj, function () {
143-
that.emit("error", e, obj);
144-
if (callback) {
145-
callback(e);
146-
}
147-
});
148-
}
139+
that.runAfterHooks(method, e, obj, function () {
140+
that.emit("error", e, obj);
141+
if (callback) {
142+
callback(e);
143+
}
144+
});
149145
} else {
150146
if (Array.isArray(result)) {
151147
result = result.map(function (r) {

0 commit comments

Comments
 (0)