Error Codes

Various errors can occur during calls to the IronWeb SDK. The SDK exposes error codes that help developers decision off of errors in order to handle them as appropriate for their application. The following error codes will be attached to the SDKError instance that is exposed in the catch handler for returned Promises.

Each error that can occur within the SDK will also have a message which can help developers determine what happened as part of the failure. The error code is a way to classify errors to determine which part of an operation failed.

Example

import {initialize, ErrorCodes} from "@ironcorelabs/ironweb";

initialize(jwtCallback, passwordCallback)
    .then(() => {...})
    .catch((error) => {
        if (error.code === ErrorCodes.USER_PASSCODE_INCORRECT) {
            alert("User private key password was incorrect!");
        }
    });
Constant Code
JWT_FORMAT_FAILURE 100
JWT_RETRIEVAL_FAILURE 101
VERIFY_API_REQUEST_FAILURE 102
BROWSER_FRAME_MESSAGE_FAILURE 103
RANDOM_NUMBER_GENERATION_FAILURE 104
PASSCODE_FORMAT_FAILURE 105
PASSCODE_RETRIEVAL_FAILURE 106
USER_VERIFY_API_REQUEST_FAILURE 200
USER_CREATE_REQUEST_FAILURE 201
USER_UPDATE_REQUEST_FAILURE 202
USER_PASSCODE_INCORRECT 203
USER_KEY_LIST_REQUEST_FAILURE 204
USER_DEVICE_ADD_REQUEST_FAILURE 205
USER_MASTER_KEY_GENERATION_FAILURE 206
USER_DEVICE_KEY_GENERATION_FAILURE 207
USER_DEVICE_KEY_DECRYPTION_FAILURE 208
USER_PASSCODE_CHANGE_FAILURE 209
DOCUMENT_LIST_REQUEST_FAILURE 300
DOCUMENT_GET_REQUEST_FAILURE 301
DOCUMENT_CREATE_REQUEST_FAILURE 302
DOCUMENT_UPDATE_REQUEST_FAILURE 303
DOCUMENT_GRANT_ACCESS_REQUEST_FAILURE 304
DOCUMENT_REVOKE_ACCESS_REQUEST_FAILURE 305
DOCUMENT_DECRYPT_FAILURE 306
DOCUMENT_ENCRYPT_FAILURE 307
DOCUMENT_REENCRYPT_FAILURE 308
DOCUMENT_GRANT_ACCESS_FAILURE 309
DOCUMENT_MAX_SIZE_EXCEEDED 310
DOCUMENT_CREATE_WITH_ACCESS_FAILURE 311
DOCUMENT_HEADER_PARSE_FAILURE 312
GROUP_LIST_REQUEST_FAILURE 400
GROUP_GET_REQUEST_FAILURE 401
GROUP_CREATE_REQUEST_FAILURE 402
GROUP_ADD_MEMBERS_REQUEST_FAILURE 403
GROUP_ADD_MEMBER_NOT_ADMIN_FAILURE 404
GROUP_REMOVE_MEMBERS_REQUEST_FAILURE 405
GROUP_REMOVE_SELF_REQUEST_FAILURE 406
GROUP_KEY_GENERATION_FAILURE 407
GROUP_MEMBER_KEY_ENCRYPTION_FAILURE 408
GROUP_ADD_ADMINS_NOT_ADMIN_FAILURE 409
GROUP_ADD_ADMINS_REQUEST_FAILURE 410
GROUP_KEY_DECRYPTION_FAILURE 411
GROUP_REMOVE_ADMINS_REQUEST_FAILURE 412
GROUP_UPDATE_REQUEST_FAILURE 413
GROUP_DELETE_REQUEST_FAILURE 414
REQUEST_RATE_LIMITED 500