protz_i Posted July 15, 2016 Report Posted July 15, 2016 Hello ! How should i properly handle this error ? I wrapped offer.accept into Promise and when i catch error then i get errCode and if errCode === 28 what way to re-accept this offer properly ?should i return false and then try to accept offer again ? or update somehow ? Quote
Dr. McKay Posted July 15, 2016 Report Posted July 15, 2016 Just keep trying to accept it. As far as I can tell, error 28 just means Steam is being bad. Quote
Freshdachs Posted July 22, 2016 Report Posted July 22, 2016 (edited) Having the same issue. Everything works except the handling of error 28.I made a retry function but it keeps saying that offer.accept is not a function (Line 73) manager.on('newOffer', function (offer) { console.log("New offer #" + offer.id + " from " + offer.partner.getSteam3RenderedID()); offer.accept(function (err) { if (err) { console.log("Unable to accept offer: " + err.message); console.log("Cause: " + err.eresult); if (err.eresult == 28) { retryOffer(offer.id); } } else { steam.checkConfirmations(); console.log("Offer accepted"); } }); }); function retryOffer(id) { manager.getOffer(id, function (err,offer) { if (err) { console.log("Unable to get offer: " + err.message); console.log("Retrying to get."); setTimeout(function(){ retryOffer(id); }, retryTime); } else { offer.accept(function (err) { if (err) { console.log("Unable to accept offer: " + err.message); if (err.eresult == 28) { console.log("Retrying to accept."); retryOffer(offer.id); } } else { steam.checkConfirmations(); console.log("Offer accepted"); } }); } }); } Edit: Fixed the code. Maybe someone finds that useful. Thanks Dr. McKay. Awesome project, awesome help! Edited July 23, 2016 by Freshdachs Quote
Dr. McKay Posted July 22, 2016 Report Posted July 22, 2016 Your err and offer parameters are switched. 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.