MobileLockerHttpResponseError
Defined in: errors.ts:156
Thrown by mobilelocker.http.* methods when the server returns a non-2xx HTTP status.
Distinct from MobileLockerHTTPError — this means the request completed
but the server rejected it. Inspect status and data to handle the response.
Example
Section titled “Example”try { await mobilelocker.http.post(url, payload)} catch (err) { if (err instanceof MobileLockerHttpResponseError && err.status === 422) { showValidationError(err.data) }}Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MobileLockerHttpResponseError( status, statusText, headers, data): MobileLockerHttpResponseError;Defined in: errors.ts:166
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
status |
number |
statusText |
string |
headers |
Record<string, string> |
data |
unknown |
Returns
Section titled “Returns”MobileLockerHttpResponseError
Overrides
Section titled “Overrides”Properties
Section titled “Properties”readonly code: string;Defined in: errors.ts:80
Machine-readable error code. Prefer the *ErrorCode constants for comparisons.
Inherited from
Section titled “Inherited from”status
Section titled “status”readonly status: number;Defined in: errors.ts:158
HTTP status code (e.g. 404, 422, 500).
statusText
Section titled “statusText”readonly statusText: string;Defined in: errors.ts:160
HTTP status text (e.g. 'Not Found').
headers
Section titled “headers”readonly headers: Record<string, string>;Defined in: errors.ts:162
Response headers as a flat key/value map.
readonly data: unknown;Defined in: errors.ts:164
Parsed response body.