question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warning: a promise was rejected with a non-error: [object Error]

See original GitHub issue

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)

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:29 (12 by maintainers)

github_iconTop GitHub Comments

6reactions
mjomblecommented, Feb 10, 2016

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

0reactions
atifsyedalicommented, Aug 18, 2018

The only warning suppression flag I see there is for when you forget to return a promise.

wForgottenReturn is the only warning type that can be separately configured. The corresponding environmental variable key is BLUEBIRD_W_FORGOTTEN_RETURN.

Maybe I am missing something? In any case, I only get the warning on startup when es6-shim tries to initialize and test the features supported by the Promise impl in the env. See https://github.com/paulmillr/es6-shim/blob/8583cbe2186ec12bfbf4218ccbce7fc73f96de87/es6-shim.js#L2654

I’ll suppress this myself so no worries. Just wanted to know if there is a way to turn it off already.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Promise rejected with non-error warning - Stack Overflow
This just means that the error that was thrown is not an instanceof Error . For example, the following is not an error,...
Read more >
a promise was rejected with a non-error: [object Array] · Issue ...
Working with native Promise i got this warning. Warning: a promise was rejected with a non-error: [object Array] If validation errors exists ......
Read more >
Warning Explanations - Bluebird.js
Warning: a promise was rejected with a non-error. Due to a historic mistake in JavaScript, the throw statement is allowed to be used...
Read more >
Non-Error promise rejection captured with value - #sentry
I'm getting tons of errors from from what appears to be a recursive call generating a lot of errors from one unhandled exception:...
Read more >
توییتر \ Kat Marchán در توییتر: «(node:3864) Warning: a ...
(node:3864) Warning: a promise was rejected with a non-error: [object Undefined] Is there any way to get node.js to give me a callsite?...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found