Skip to content

Commit

Permalink
fix: notify session expired on 403
Browse files Browse the repository at this point in the history
  • Loading branch information
Noobgam committed Apr 6, 2024
1 parent d04af9d commit 7e0808e
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 7e0808e

Please sign in to comment.