src/core/interceptors/smart-web-handler-error.interceptor.ts
HTTP interceptor that normalizes PASOE web handler errors.
Detects when a request expecting JSON receives a response with Content-Type: text/html (e.g., a WebSpeed compatibility handler page) and rethrows a clearer HttpErrorResponse with actionable guidance.
Methods |
|
| Public intercept | ||||||||||||
intercept(req: HttpRequest
|
||||||||||||
|
Intercepts HTTP requests and responses to normalize PASOE web handler errors. This method checks both successful responses and failed responses for unexpected HTML content when JSON was expected, and converts them into a normalized HttpErrorResponse with a clear configuration hint.
Parameters :
Returns :
Observable<HttpEvent<any>>
An observable that may emit a normalized error |