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

Expose ZoneAwareError and UncaughtPromiseError #996

@trshafer

Description

@trshafer

UncaughtPromiseError provides the original error which is thrown on the rejection property:

error.rejection = value;

It would be helpful to be able to check in angular's error handler what the original error is. In order to safely check what the original error is, it would be helpful to have compiler checking on UncaughtPromiseError. Something like:

import {UncaughtPromiseError} from '@angular/zone';
import {ErrorHandler} from '@angular/core';

export class MyErrorHandler implements ErrorHandler {
  handleError(error: Error|UncaughtPromiseError) {
    if(error.rejection) {
      // do something with the original error
    }
  }
}

Zone is not exposed as an angular npm module, so that might also be a requirement.

Right now the only way to accomplish this is to duplicate the UncaughtPromiseError interface, which is error prone.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions