import { ProtocolError } from '@webpieces/http-api'; /** * ClientErrorTranslator - Translates HTTP error responses to HttpError exceptions. * * This is the CLIENT-SIDE reverse of ExpressWrapper.handleError() on the server. * It reconstructs typed HttpError exceptions from ProtocolError JSON responses. * * Architecture: * - Server: HttpError → ExpressWrapper.handleError() → ProtocolError JSON * - Client: ProtocolError JSON → ClientErrorTranslator.translateError() → HttpError * * This achieves symmetric error handling - server throws typed exceptions, * client receives typed exceptions. */ export declare class ClientErrorTranslator { /** * Parse error response and reconstruct appropriate HttpError subclass. * * Maps HTTP status codes to error types (symmetric with server): * - 400 → HttpBadRequestError (with field, guiAlertMessage) * - 266 → HttpUserError (with errorCode) - 2xx code for user validation * - 401 → HttpUnauthorizedError * - 403 → HttpForbiddenError * - 404 → HttpNotFoundError * - 408 → HttpTimeoutError * - 500 → HttpInternalServerError * - 502 → HttpBadGatewayError * - 504 → HttpGatewayTimeoutError * - 598 → HttpVendorError (with waitSeconds) - custom status code * - other → generic HttpError * * @param response - Fetch Response object * @param protocolError - Parsed ProtocolError from response body * @returns HttpError subclass instance */ static translateError(response: Response, protocolError: ProtocolError): Error; }