-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
const Bluebird = require('bluebird');
Bluebird.resolve(1).timeout(200);
Unhandled rejection TypeError: Cannot read property 'apply' of undefined
at bound (domain.js:280:13)
at runBound (domain.js:293:12)
at tryCatcher (/Users/assaf/Dropbox/projects/webapp/node_modules/bluebird/js/release/util.js:11:23)
at Promise._settlePromiseFromHandler (/Users/assaf/Dropbox/projects/webapp/node_modules/bluebird/js/release/promise.js:486:31)
at Promise._settlePromise (/Users/assaf/Dropbox/projects/webapp/node_modules/bluebird/js/release/promise.js:549:18)
at Promise._settlePromiseCtx (/Users/assaf/Dropbox/projects/webapp/node_modules/bluebird/js/release/promise.js:586:10)
at Async._drainQueue (/Users/assaf/Dropbox/projects/webapp/node_modules/bluebird/js/release/async.js:130:12)
at Async._drainQueues (/Users/assaf/Dropbox/projects/webapp/node_modules/bluebird/js/release/async.js:135:10)
at Immediate.Async.drainQueues [as _onImmediate] (/Users/assaf/Dropbox/projects/webapp/node_modules/bluebird/js/release/async.js:16:14)
at processImmediate [as _immediateCallback] (timers.js:368:17)It seems that timeout works correctly as long as the promise is not fulfilled/rejected. So this will work:
Bluebird.resolve( Bluebird.resolve( Bluebird.delay(1) ) ).timeout(200);This will not work:
Bluebird.resolve( Bluebird.resolve(0) ).timeout(200);Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels