File

src/core/interceptors/smart-web-handler-error.interceptor.ts

Description

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.

Index

Methods

Methods

Public intercept
intercept(req: HttpRequest, next: HttpHandler)

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 :
Name Type Optional Description
req HttpRequest<any> No
  • The outgoing HTTP request
next HttpHandler No
  • The next handler in the interceptor chain
Returns : Observable<HttpEvent<any>>

An observable that may emit a normalized error

results matching ""

    No results matching ""