Skip to content

Commit dedf433

Browse files
committed
use error function for >= 400 codes
1 parent 8192995 commit dedf433

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/http.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,12 @@ SwaggerHttp.prototype.execute = function (obj, opts) {
9090
};
9191

9292
obj.on.response = function(data) {
93-
responseInterceptor(data);
93+
if(data && data.status >= 400) {
94+
errorInterceptor(data);
95+
}
96+
else {
97+
responseInterceptor(data);
98+
}
9499
};
95100

96101
if (_.isObject(obj) && _.isObject(obj.body)) {

0 commit comments

Comments
 (0)