mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-21 23:41:18 +01:00
catch HTTP 500/503 and empty response, fixes #141
This commit is contained in:
parent
750d741308
commit
b97087c099
@ -91,6 +91,8 @@ exp.get_from_options = function(rid, url, options, callback) {
|
|||||||
break;
|
break;
|
||||||
case 404:
|
case 404:
|
||||||
case 204:
|
case 204:
|
||||||
|
case 500:
|
||||||
|
case 503:
|
||||||
// we don't want to cache this
|
// we don't want to cache this
|
||||||
body = null;
|
body = null;
|
||||||
break;
|
break;
|
||||||
@ -107,6 +109,11 @@ exp.get_from_options = function(rid, url, options, callback) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (body && !body.length) {
|
||||||
|
// empty response
|
||||||
|
body = null;
|
||||||
|
}
|
||||||
|
|
||||||
callback(body, response, error);
|
callback(body, response, error);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user