diff --git a/client/src/app/core/interceptors/error.interceptor.ts b/client/src/app/core/interceptors/error.interceptor.ts index 867d867..2ec41e4 100644 --- a/client/src/app/core/interceptors/error.interceptor.ts +++ b/client/src/app/core/interceptors/error.interceptor.ts @@ -6,7 +6,7 @@ import { HttpInterceptor } from '@angular/common/http'; import { catchError, Observable, throwError } from 'rxjs'; -import { Router } from '@angular/router'; +import { NavigationExtras, Router } from '@angular/router'; import { ToastrService } from 'ngx-toastr'; @Injectable() @@ -37,7 +37,8 @@ export class ErrorInterceptor implements HttpInterceptor { } if (error.status === 500){ - this.router.navigateByUrl('/server-error'); + const navigationExtras: NavigationExtras = {state: {error: error.error}}; + this.router.navigateByUrl('/server-error', navigationExtras); } } return throwError(() => new Error(error)); diff --git a/client/src/app/core/server-error/server-error.component.html b/client/src/app/core/server-error/server-error.component.html index 95017c1..d301fcb 100644 --- a/client/src/app/core/server-error/server-error.component.html +++ b/client/src/app/core/server-error/server-error.component.html @@ -1,3 +1,17 @@
Note: if you are seeing this, this is not a client side error.
+What's next?
+Following is the stack trace - This is where your investigation begins.
+{{e.details}}
+