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

Intercept Unhandled Rejection #6

Description

@StabbarN

The following code is inside a ng-click callback:

Promise.resolve().then(() => {
    return Promise.reject('Test reject outside angular')
})

Shouldn't this rejection be sent to Opbeat?

Rejections inside $q is sent to Opbeat, such as:

$q.resolve(Promise.resolve()).then(() => {
    return Promise.reject('Test reject inside angular')
})

We use angularjs 1.6.1, Opbeat Angular 3.9.1. and latest Babel (transpiled from es2015). Tested on latest Chrome and Firefox.

Web browser console prints:

Unhandled Promise rejection: Test reject outside angular ; Zone: opbeatRootZone ; Task: Promise.then ; Value: Test reject outside angular undefined
consoleError @ opbeat-angular.js:4519
_loop_1 @ opbeat-angular.js:4546
drainMicroTaskQueue @ opbeat-angular.js:4550
ZoneTask.invoke @ opbeat-angular.js:4472
opbeat-angular.js:4521 Error: Uncaught (in promise): Test reject outside angular
    at resolvePromise (opbeat-angular.js:4593)
    at resolvePromise (opbeat-angular.js:4578)
    at opbeat-angular.js:4626
    at ZoneDelegate.invokeTask (opbeat-angular.js:4400)
    at Object.onInvokeTask (opbeat-angular.js:3921)
    at ZoneDelegate.invokeTask (opbeat-angular.js:4399)
    at Zone.runTask (opbeat-angular.js:4300)
    at drainMicroTaskQueue (opbeat-angular.js:4532)
    at HTMLButtonElement.ZoneTask.invoke (opbeat-angular.js:4472)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions