So I have a global error handler in my ionic app…
When an error is triggered within an rxjs pipe … the handler will receive the error and is sent to the server
But errors on other parts of the code never make it to the global error handler.
I’m on ionic 5. Any ideas?
--- app.module.ts
{ provide: ErrorHandler, useClass: GlobalErrorHandler, deps: [ErrorService] }
--- my global error handler class
import { ErrorService } from "src/app/services/common/error.service";
import { ErrorHandler } from "@angular/core";
export class GlobalErrorHandler extends ErrorHandler {
constructor(private errorService: ErrorService){
super()
}
handleError(error: any): void {
// here my code sends the error to the server
}
}
Sounds to me that only “ngZone” or “angular” errors are being handled by this. Is there a way I can catch ALL errors?
2 posts - 1 participant