cookie Posted April 7, 2016 Report Posted April 7, 2016 Is there a way that I can intentionally make offer.send() returns an error? Quote
cookie Posted April 7, 2016 Author Report 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
Dr. McKay Posted April 7, 2016 Report 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
cookie Posted April 9, 2016 Author Report 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
cookie Posted April 10, 2016 Author Report Posted April 10, 2016 You'll get double callbacks.forgot to add a return; Quote
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.