mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2025-01-04 07:36:55 +08:00
Make it possible to skip json error check
This commit is contained in:
parent
ed12a54e81
commit
a8eedb3067
@ -50,7 +50,7 @@ SteamCommunity.prototype.httpRequest = function(uri, options, callback, source)
|
||||
var httpError = options.checkHttpError !== false && self._checkHttpError(err, response, callback);
|
||||
var communityError = !options.json && options.checkCommunityError !== false && self._checkCommunityError(body, httpError ? function () {} : callback); // don't fire the callback if hasHttpError did it already
|
||||
var tradeError = !options.json && options.checkTradeError !== false && self._checkTradeError(body, httpError || communityError ? function () {} : callback); // don't fire the callback if either of the previous already did
|
||||
var jsonError = options.json && !body ? new Error("Malformed JSON response") : null;
|
||||
var jsonError = options.json && options.checkJsonError !== false && !body ? new Error("Malformed JSON response") : null;
|
||||
|
||||
self.emit('postHttpRequest', requestID, source, options, httpError || communityError || tradeError || jsonError || null, response, body, {
|
||||
"hasCallback": hasCallback,
|
||||
|
Loading…
Reference in New Issue
Block a user