Added a handler to send the client errors to the backend. Updated the launch settings to reload the fastapi app on file changes.

This commit is contained in:
2026-09-02 02:35:53 +00:00
parent cf680cd254
commit 6cf42d3641
9 changed files with 311 additions and 5 deletions
+5
View File
@@ -2,6 +2,7 @@ import { LayoutModule } from '@angular/cdk/layout';
import { provideHttpClient, withInterceptors } from '@angular/common/http';
import {
ApplicationConfig,
ErrorHandler,
LOCALE_ID,
importProvidersFrom,
isDevMode,
@@ -31,6 +32,8 @@ import { routes } from './app.routes';
import { AuthService } from './auth/auth.service';
import { authInterceptor } from './core/auth.interceptor';
import { delayInterceptor } from './core/delay-interceptor';
import { GlobalErrorHandler } from './core/global-error-handler';
import { httpErrorInterceptor } from './core/http-error.interceptor';
import { jwtInterceptor } from './core/jwt.interceptor';
import { refreshInterceptor } from './core/refresh.interceptor';
@@ -61,6 +64,7 @@ export const appConfig: ApplicationConfig = {
authInterceptor,
jwtInterceptor,
refreshInterceptor,
httpErrorInterceptor,
...(isDevMode() ? [delayInterceptor] : []),
]),
),
@@ -71,6 +75,7 @@ export const appConfig: ApplicationConfig = {
}),
withComponentInputBinding(),
),
{ provide: ErrorHandler, useClass: GlobalErrorHandler },
{ provide: DateAdapter, useClass: LuxonDateAdapter, deps: [MAT_DATE_LOCALE] },
{ provide: MAT_DATE_FORMATS, useValue: dateFormat },
{ provide: MAT_SNACK_BAR_DEFAULT_OPTIONS, useValue: { duration: 3000 } },