cookie Posted April 7, 2016 Report Share Posted April 7, 2016 Is there a way that I can intentionally make offer.send() returns an error? Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted April 7, 2016 Report Share Posted April 7, 2016 Sure, add a bad item to the offer. Quote Link to comment Share on other sites More sharing options...
cookie Posted April 7, 2016 Author Report Share Posted April 7, 2016 Sure, add a bad item to the offer. No but I mean I want it to be sent but an error is thrown so I can debug my function in unknownOfferSent Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted April 7, 2016 Report Share Posted April 7, 2016 I don't believe you could do that without editing the module's code directly. If you run the bot and send an offer manually, it'll trigger unknownOfferSent. Quote Link to comment Share on other sites More sharing options...
cookie Posted April 9, 2016 Author Report Share Posted April 9, 2016 I don't believe you could do that without editing the module's code directly. If you run the bot and send an offer manually, it'll trigger unknownOfferSent. if(!callback) { return; } callback(new Error("Intentionally returned an error")); if(body && this.state == ETradeOfferState.PendingConfirmation) { callback(null, 'pending'); } else if(body && body.tradeofferid) { callback(null, 'sent'); } else { callback(new Error("Unknown response")); } that will work I guess Quote Link to comment Share on other sites More sharing options...
Dr. McKay Posted April 9, 2016 Report Share Posted April 9, 2016 You'll get double callbacks. Quote Link to comment Share on other sites More sharing options...
cookie Posted April 10, 2016 Author Report Share Posted April 10, 2016 You'll get double callbacks.forgot to add a return; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.