Skip to content

Class: ErrorMapper

Class: ErrorMapper

Defined in: auth-server-ts/src/http/error-mapper.ts:28

Map (HTTP status, error envelope) → typed exception subclass.

The auth-server envelope (pkg/shared/errors.WriteAPIError):

{ “code”: “TOKEN_EXPIRED”, “message”: ”…”, “details”: {…}, “request_id”: ”…” }

Some endpoints (legacy) use { "error": { "code", "message" } } — we defensively parse both shapes.

Mirrors PHP’s Vendidit\AuthServer\Http\ErrorMapper.

Constructors

Constructor

new ErrorMapper(): ErrorMapper

Returns

ErrorMapper

Methods

fromResponse()

static fromResponse(status, body, headers?): VenAuthException

Defined in: auth-server-ts/src/http/error-mapper.ts:29

Parameters

status

number

body

Record<string, unknown> | null

headers?

Record<string, string | string[]> = {}

Returns

VenAuthException