BlueBird exceptions
See original GitHub issueHello,
for some reason BlueBird throws handled exceptions when RequestError: Error: ESOCKETTIMEDOUT
happens. In bluebird\js\release\util.js line 16 it throws for this execution: return target.apply(this, arguments);
That’s the full stack trace I get when this happens:
6:07:25 PM - error: RequestError: Error: ESOCKETTIMEDOUT at new RequestError (c:\Users\h9pe\Documents\projectname.io-express\node_modules\request-promise-core\lib\errors.js:14:15) at Request.module.exports.plumbing.callback (c:\Users\h9pe\Documents\projectname.io-express\node_modules\request-promise-core\lib\plumbing.js:87:29) at Request.RP$callback [as _callback] (c:\Users\h9pe\Documents\projectname.io-express\node_modules\request-promise-core\lib\plumbing.js:46:31) at Request.init.self.callback (c:\Users\h9pe\Documents\projectname.io-express\node_modules\request\request.js:188:22) at emitOne (events.js:96:13) at Request.emit (events.js:188:7) at ClientRequest.<anonymous> (c:\Users\h9pe\Documents\projectname.io-express\node_modules\request\request.js:822:16) at ClientRequest.g (events.js:291:16) at emitNone (events.js:86:13) at ClientRequest.emit (events.js:185:7) at Socket.emitTimeout (_http_client.js:629:10) at Socket.g (events.js:291:16) at emitNone (events.js:86:13) at Socket.emit (events.js:185:7) at Socket._onTimeout (net.js:342:8) at ontimeout (timers.js:380:14) at tryOnTimeout (timers.js:244:5) at Timer.listOnTimeout (timers.js:214:5)
I am using bluebird 3.5.0 and request-promise 4.2.1. What am I doing wrong / what is the issue?
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (6 by maintainers)
The code looks perfect. You do many parallel requests so that is probably the reason why you get a ESOCKETTIMEDOUT in the first place.
Wait a moment. Why are you wondering about the error passing through util.js? Isn’t the error correctly passed down to your catch handler and you get the “Error during upsert leaderboard task” output?!
P.S.: True, the code is complex but this is how you do it with promises. However, if you use node v6 and up you should look into
Bluebird.coroutine(function *() { ... })
. It’s a game changer!@weeco i see… just noticed i was doing some risky REST requests, thanks!