Angular custom error handler not getting error type from promise
问题 When thrown from a promise every Error my custom error handler is getting does loose its type import { HttpErrorResponse } from "@angular/common/http"; import { ErrorHandler, Injectable, Injector, NgZone } from "@angular/core"; import { MatSnackBar } from "@angular/material"; @Injectable() export class GlobalErrorHandler implements ErrorHandler { constructor(private injector: Injector) { } handleError(error: any): void { if (error instanceof HttpErrorResponse) // this needs to be triggered