bluebird: Warning: a promise was rejected with a non-error: [object Error]
A warning is fired when I reject a Promise with an new Error('...')
, but Promise and Error are from different Window
's (e.g. window.opener and window child - from window.open or iframe.contentWindow).
Of cource, it means, that rejectReason instanceof Error
returns false
, because Error is instance of iframe.contentWindow.Error (not of window.Error)
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 29 (12 by maintainers)
Commits related to this issue
- fix(errors): spurious Bluebird warnings The way Sequelize instantiates some of its Error subclasses confuses Bluebird into thinking that Promises are rejected with non-Error objects. See https://git... — committed to gabegorelick/sequelize by gabegorelick 7 years ago
- Better error check See https://github.com/petkaantonov/bluebird/issues/990#issuecomment-333598787 — committed to gabegorelick/bluebird by gabegorelick 7 years ago
- fix(errors): spurious Bluebird warnings (#8408) The way Sequelize instantiates some of its Error subclasses confuses Bluebird into thinking that Promises are rejected with non-Error objects. See... — committed to sequelize/sequelize by gabegorelick 7 years ago
I’m also getting the “promise was rejected with a non-error” warning for regular
new Error(...)
type errors when the code runs inside PhantomJS with Bluebird 3.x.It worked fine with Bluebird 2.9.x