Skip to content

Commit

Permalink
Merge pull request #352 from Noobgam/noobgam/notify-session-expired-403
Browse files Browse the repository at this point in the history
fix: notify session expired on 403
  • Loading branch information
DoctorMcKay authored Apr 11, 2024
2 parents d04af9d + 7e0808e commit 84867a9
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions lib/webapi.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,13 @@ TradeOfferManager.prototype._apiCall = function(httpMethod, method, version, inp
options[httpMethod == 'GET' ? 'qs' : 'form'] = input;

this._community.httpRequest(options, (err, response, body) => {
if (err) {
err.body = body;
callback(err);
return;
}

var error;
var error = err;

if (response.statusCode != 200) {
if (response.statusCode != 200 && !error) {
error = new Error('HTTP error ' + response.statusCode);
}

if (error) {
error.body = body;

if (typeof response.body === 'string' && response.body.indexOf('Access is denied') >= 0) {
Expand Down

0 comments on commit 84867a9

Please sign in to comment.