Skip to content

MobileLockerError

Defined in: errors.ts:78

Base error class thrown by SDK methods.

Domain-specific errors extend this class so instanceof MobileLockerError matches all of them.

try {
await mobilelocker.user.get()
} catch (err) {
if (err instanceof MobileLockerError && err.code === GeneralErrorCode.NotConnected) {
showOfflineBanner()
}
}
  • Error
new MobileLockerError(message, code?): MobileLockerError;

Defined in: errors.ts:82

Parameter Type Default value
message string undefined
code string GeneralErrorCode.ServerError

MobileLockerError

Error.constructor
readonly code: string;

Defined in: errors.ts:80

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