Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

$q reports errors in promise callbacks even when they are caught #7992

Closed
@domenic

Description

@domenic

Plunker: http://plnkr.co/edit/5vMj4AJibWcnTKYR5z73?p=preview

I have caught the error and used it to display useful information to my user in the UI. However, Angular still logs a big ol' stack trace to the console.

This isn't a spec compliance issue (since the error isn't thrown, just logged), but it's a developer ergonomics issue. I don't understand how using $q on any reasonably large promise project would not just result in a console filled with spurious errors.

As always, the correct time to report a rejection as unhandled is debatable. Bluebird does it at the end of turn, whereas Q doesn't do it at all, relying on .done() instead. But this isn't even about unhandled rejections---it's about all rejections!

The Bluebird strategy seems like a pure win: it would remove this spurious reporting, but keep it for any cases that could potentially be real.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions