Skip to content

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.

try {
await mobilelocker.http.post(url, payload)
} catch (err) {
if (err instanceof MobileLockerHttpResponseError && err.status === 422) {
showValidationError(err.data)
}
}
new MobileLockerHttpResponseError(
status,
statusText,
headers,
data): MobileLockerHttpResponseError;

Defined in: errors.ts:166

Parameter Type
status number
statusText string
headers Record<string, string>
data unknown

MobileLockerHttpResponseError

MobileLockerError.constructor

readonly code: string;

Defined in: errors.ts:80

Machine-readable error code. Prefer the *ErrorCode constants for comparisons.

MobileLockerError.code


readonly status: number;

Defined in: errors.ts:158

HTTP status code (e.g. 404, 422, 500).


readonly statusText: string;

Defined in: errors.ts:160

HTTP status text (e.g. 'Not Found').


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.