New warnings in 3.0
See original GitHub issueAll my jasmine tests started producing over thousand warnings, after upgrading from 2.x
to 3.x
Warning: a promise was rejected with a non-error: [object Array]
Warning: a promise was created in a handler but none were returned from it
And this is all for a library that passes tests without warnings against every promise library there is out there, including Bluebird 2.x
I went through the code referred to by the warnings, and none of them make sense to me, i.e. they look completely wrong.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:25 (17 by maintainers)
Top Results From Across the Web
warnings — Warning control — Python 3.11.1 documentation
Warning messages are typically issued in situations where it is useful to alert the user of some condition in a program, where that...
Read more >Travel Health Notices - CDC
Warning Level 3 (Red): Avoid all non-essential travel to this destination. The outbreak is of high risk to travelers and no precautions are...
Read more >What to Know: FDA Issues Warnings About 3 At-Home COVID ...
The Food and Drug Administration has issued warnings to the public about three different at-home COVID-19 tests, saying that the testing kits ...
Read more >National Weather Service
Heavy Rain in the South; Parade of Storms for the West into the New Year · Winter Storm Warning · High Wind Warning...
Read more >FDA Drug Safety Communication: FDA review results in new ...
FDA Drug Safety Communication: FDA review results in new warnings ... or procedures in children younger than 3 years or in pregnant women ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@vitaly-t bluebird is an opinionated promise library, our philosophy is to make things that work for 99% of people 100% of the time. If you don’t like the opinion of the library that’s fine - you’re more than welcome to fork it it’s an open source project.
Rejecting with non-errors is an obvious bug, an array is not an error - it doesn’t have a stack trace and it’ll make your life hell to
throw
arrays (or reject with them) in large production code bases.Creating promises in then but not handling them is an obvious bug as well - most likely a deferred anti-pattern which leaves room for a lot of errors.
Wow, those two are shocking changes…
Warning: a promise was rejected with a non-error: [object Array]
That’s trying to create your own standard against what JavaScript supports, like
throw;
, which is a perfectly valid command, and is not meant to produce any warning, and the same is expected from any promise library.Warning: a promise was created in a handler but none were returned from it
In my code and in other people’s it is all over the place when
undefined
is used as a perfectly good value to either return or resolve with. Your warning here is breaking a perfectly good code pattern, and nobody is gonna like that.In all, I think you will be crucified for these two warnings, unless you turn around quickly and make them optional, that which I strongly suggest.