mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-21 11:35:34 +01:00
Add Custom ErrorHandler
(#8543)
This commit is contained in:
parent
136226b6be
commit
45f9f5695e
14
libs/angular/src/platform/services/logging-error-handler.ts
Normal file
14
libs/angular/src/platform/services/logging-error-handler.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import { ErrorHandler, Injectable } from "@angular/core";
|
||||
|
||||
import { LogService } from "@bitwarden/common/platform/abstractions/log.service";
|
||||
|
||||
@Injectable()
|
||||
export class LoggingErrorHandler extends ErrorHandler {
|
||||
constructor(private readonly logService: LogService) {
|
||||
super();
|
||||
}
|
||||
|
||||
override handleError(error: any): void {
|
||||
this.logService.error(error);
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
import { LOCALE_ID, NgModule } from "@angular/core";
|
||||
import { ErrorHandler, LOCALE_ID, NgModule } from "@angular/core";
|
||||
|
||||
import {
|
||||
AuthRequestServiceAbstraction,
|
||||
@ -238,6 +238,7 @@ import { UnauthGuard } from "../auth/guards/unauth.guard";
|
||||
import { FormValidationErrorsService as FormValidationErrorsServiceAbstraction } from "../platform/abstractions/form-validation-errors.service";
|
||||
import { BroadcasterService } from "../platform/services/broadcaster.service";
|
||||
import { FormValidationErrorsService } from "../platform/services/form-validation-errors.service";
|
||||
import { LoggingErrorHandler } from "../platform/services/logging-error-handler";
|
||||
import { AngularThemingService } from "../platform/services/theming/angular-theming.service";
|
||||
import { AbstractThemingService } from "../platform/services/theming/theming.service.abstraction";
|
||||
import { safeProvider, SafeProvider } from "../platform/utils/safe-provider";
|
||||
@ -1070,6 +1071,11 @@ const safeProviders: SafeProvider[] = [
|
||||
useClass: DefaultOrganizationManagementPreferencesService,
|
||||
deps: [StateProvider],
|
||||
}),
|
||||
safeProvider({
|
||||
provide: ErrorHandler,
|
||||
useClass: LoggingErrorHandler,
|
||||
deps: [LogService],
|
||||
}),
|
||||
];
|
||||
|
||||
function encryptServiceFactory(
|
||||
|
Loading…
Reference in New Issue
Block a user