1717
1818import { BrowserModule } from "@angular/platform-browser" ;
1919import { BrowserAnimationsModule } from "@angular/platform-browser/animations" ;
20- import { ErrorHandler , Inject , LOCALE_ID , NgModule } from "@angular/core" ;
20+ import {
21+ APP_INITIALIZER ,
22+ ErrorHandler ,
23+ Inject ,
24+ LOCALE_ID ,
25+ NgModule ,
26+ } from "@angular/core" ;
2127import { HttpClientModule } from "@angular/common/http" ;
28+ import * as Sentry from "@sentry/angular" ;
2229
2330import { AppComponent } from "./app.component" ;
2431import { allRoutes } from "./app.routing" ;
@@ -31,7 +38,6 @@ import {
3138 SwRegistrationOptions ,
3239} from "@angular/service-worker" ;
3340import { environment } from "../environments/environment" ;
34- import { LoggingErrorHandler } from "./core/logging/logging-error-handler" ;
3541import { AnalyticsService } from "./core/analytics/analytics.service" ;
3642import { ConfigurableEnumModule } from "./core/basic-datatypes/configurable-enum/configurable-enum.module" ;
3743import { MatPaginatorIntl } from "@angular/material/paginator" ;
@@ -75,7 +81,7 @@ import { HistoricalDataModule } from "./features/historical-data/historical-data
7581import { MatchingEntitiesModule } from "./features/matching-entities/matching-entities.module" ;
7682import { ProgressDashboardWidgetModule } from "./features/dashboard-widgets/progress-dashboard-widget/progress-dashboard-widget.module" ;
7783import { ReportingModule } from "./features/reporting/reporting.module" ;
78- import { RouterModule } from "@angular/router" ;
84+ import { Router , RouterModule } from "@angular/router" ;
7985import { TodosModule } from "./features/todos/todos.module" ;
8086import moment from "moment" ;
8187import { getLocaleFirstDayOfWeek } from "@angular/common" ;
@@ -141,7 +147,22 @@ import { AdminModule } from "./core/admin/admin.module";
141147 MatDialogModule ,
142148 ] ,
143149 providers : [
144- { provide : ErrorHandler , useClass : LoggingErrorHandler } ,
150+ /* Sentry setup */
151+ {
152+ provide : ErrorHandler ,
153+ useValue : Sentry . createErrorHandler ( ) ,
154+ } ,
155+ {
156+ provide : Sentry . TraceService ,
157+ deps : [ Router ] ,
158+ } ,
159+ {
160+ provide : APP_INITIALIZER ,
161+ useFactory : ( ) => ( ) => { } ,
162+ deps : [ Sentry . TraceService ] ,
163+ multi : true ,
164+ } ,
165+
145166 { provide : MatPaginatorIntl , useValue : TranslatableMatPaginator ( ) } ,
146167 { provide : ComponentRegistry , useValue : componentRegistry } ,
147168 { provide : EntityRegistry , useValue : entityRegistry } ,
0 commit comments