Testing and Error Handling
The Datil-test and Datil-dev testnets are now live and are superseding the Manzano and Cayenne testnet respectively.
The Datil mainnet is now live and superseding the Habanero mainnet, ready to store real world assets.
Check out the migration docs to learn how you can start building on the Datil networks today.
Currently we have manual tests that you can run in the browser in manual_tests.html
. To run these, set up a HTTP server in the build folder. We use python for this with the built in SimpleHTTPServer module by running python2 -m SimpleHTTPServer
and then going to http://localhost:8000/manual_tests.html
in a browser.
There is also an attempt at automated tests in the tests folder but running it with nodejs does not work because this project is bundled. An attempt at bundling the tests as well is in esbuild-tests.js
which should work someday, but more work needs to be done.
SDK Error Handling
Errors are thrown as exceptions when something has gone wrong. Errors are objects with a message, name, and errorCode. Possible codes are documented below.
- jalapeno
- serrano, datil-dev
error code | reason |
---|---|
access_control_conditions_check_failed | The Lit nodes failed to check the condition. This means that the Lit nodes could not talk to the chain to check the condition. This could be because the RPC servers are down, or because the condition is making an incorrect smart contract call that reverts. |
encrypted_symmetric_key_not_found | Could not find the encrypted symmetric key you passed in. You should have already called saveEncryptionKey which returned the encrypted symmetric key. |
exp_wrong_or_too_large | When signing a JWT, the EXP is too large or wrong. This usually means that your system clock is wrong. Please check it and make sure it is set accurately for your timezone. |
iat_outside_grace_period | When signing a JWT, the IAT is outside the grace period. This usually means that your system clock is wrong. Please check it and make sure it is set accurately for your timezone. |
incorrect_access_control_conditions | The access control conditions you passed in do not match the ones that were set by the condition creator for this resourceId or encryptedSymmetricKey. |
invalid_auth_sig | The auth_sig passed to the nodes is invalid or could not be verified. Make sure that you are passing the correct auth_sig. |
invalid_unified_condition_type | In a unified access control condition, you passed an invalid conditionType . Check the docs to see what valid types here. |
lit_node_client_not_ready | The Lit node client is not ready. This means that the Lit node client is not connected to the Lit network. You should run await litNodeClient.connect() before calling any other methods that use the Lit Node Client. |
missing_access_control_conditions | You must pass either access_control_conditions or evm_contract_conditions or sol_rpc_conditions, and you did not pass these things to the nodes. |
not_authorized | Thrown when the user does not have access to decrypt or is unauthorized to receive a JWT for an item. |
resource_id_not_found | Could not find the resource ID you passed in. You should have already called saveSigningCondition with the exact same resource ID. |
rpc_error | The Lit Node(s) could not complete the RPC call. This could be because the RPC servers are down, or because the RPC call is making an incorrect smart contract call that reverts. |
storage_error | An error occurred storing the condition. This usually means that you tried to update a permanent condition, or you tried to update a non-permanent condition from the wrong account. Only the creator of a condition can update it, and only if \"permanent\": false was originally passed in when storing the condition. |
wrong_network | The user is on the wrong network. For example, this may mean the user has ethereum selected in their wallet but they were trying to use polygon for the current operation. |
unknown_error | An unknown error has occurred. Please contact us on Discord to report this error. |
error code | reason |
---|---|
NodeSystemFault | An internal node error occured. Please try again. If this error persists contact us on Discord. |
NodeAccessControlConditionsCheckFailed | The provided Authsig doesn't meet the access conditions. |
NodeEncryptedSymmetricKeyNotFound | The provided encryptedSymmetricKey doesn't exist. |
NodeExpWrongOrTooLarge | The provided exp param is either expired or is too much in the future. |
NodeIatOutsideGracePeriod | The provided iat param is either outside the grace_period or the issue time is in the future. |
NodeAuthFailed | The authMethod isn't allowed for the provided PKP. |
NodeInvalidAuthSig | The provided Authsig is invalid. Please ensure that the Authsig is in the required format as provided here |
NodeAuthSigNotSupported | Multiple Authsigs not supported for the function. |
NodeInvalidEthereumSolanaAuthSig | Either the Authsig isn't provided or all the provided Authsigs are invalid. |
NodeInvalidED25519AuthSig | The provided Authsig isn't Ed25519 compliant. Please ensure that the Authsig is in the required format as provided here |
NodeInvalidAuthSigSigningAlgo | The provided algo param in the sessionSigs isn't supported. The ONLY supported algo is "ed25519". |
NodeInvalidUnifiedAuthSig | Either no Authsig is provided in the unified conditions or all the provided Authsigs in the are invalid. |
NodeInvalidEthereumAuthSig | Either no Ethereum Authsig isn't provided or is invalid. |
NodeInvalidCosmosAuthSig | Either no Cosmos Authsig isn't provided or is invalid. |
NodeInvalidCosmosSDKSignature | Invalid chain for the provided Cosmos signature. The ONLY supported chains are "cosmos" & "kyve". |
NodeInvalidKyveAuthSig | Either no Kyve Authsig isn't provided or is invalid. |
NodeInvalidSolanaAuthSig | Either no Solana Authsig isn't provided or is invalid. |
NodeAuthSigAddressConversionError | Couldn't convert the Authsig address to Ethereum address. Please ensure that the Authsig address is Ethereum compliant. |
NodeConditionAddressConversionError | Couldn't convert the provided accessControlCondition param from hex string to bytes. |
NodeConditionTokenIdParsingError | Couldn't parse the provided accessControlCondition's tokenId. Please look at the returned error for more info. |
NodeInvalidIPFSID | Invalid IPFS CID. |
NodeAuthSigSignatureConversionError | Invalid Authsig.sig param. Please look at the returned error for more info & ensure it's compatible as given here |
NodeAuthSigSessionKeyConversionError | Invalid Authsig.address param. Please look at the returned error for more info ensure it's compatible as given here |
NodeAuthSigSignedMessageConversionError | Invalid Authsig.signedMessage param. Please look at the returned error for more info ensure it's compatible as given here |
NodeInvalidAuthSigSessionKeySignature | The provided sessionSig is invalid. Please look at the error for more info. |
NodeMissingAccessControlConditions | No Access Control Condition provided. You have to provide at least one of the accessControlCondition, evmContractConditions, solRpConditions |
NodeNotAuthorized | The Lit node requested isn't a validator in the current epoch. Please try again. If this error persists contact us on Discord. |
NodeResourceIdNotFound | Invalid resourceId param. |
NodeRpcError | Error making the call to RPC url for the passed chain param. Please ensure that the contract call that you're making is correct including the contract address & it's passed params. Especially ensure the correctness of the functionAbi if you're using Custom Contract calls. |
NodeStorageError | An error occured while storing the encryption condition. Please look at the returned error for more info. |
NodeWrongNetwork | Either you didn't pass a chain param or it's invalid/not supported yet. Please see all the supported chain here |
NodeHTTPConversionError | Internal error with the RPC url for the provided chain param. Please try again. If this error persists contact us on Discord. |
NodeUnknownError | An unknow error occured. Please try again. If this error persists contact us on Discord. |
NodeParserError | Error parsing a provided param. Please look at the returned error for more info. |
NodeSIWECapabilityInvalid | Either the SIWE capability param isn't provided or is invalid. Please look at the returned error for more info. |
NodeSIWECapabilityActionInvalid | Invalid SIWE capability's permittedAction param. Please look at the returned error for more info. |
NodeSIWESigConversionError | Invalid SIWE capability's sig param. Please look at the returned error for more info. |
NodeSIWESessionKeySignatureInvalid | session.pubkey isn't signed in the wallet-signed SIWE message. |
NodeBlockchainError | Error making an on-chain call. Please look at the returned error for more info. |
NodeBlockchainChainUnknown | Invalid chain value for the provided Authsig.sig param. Please see all the supported chain here] |
NodeWalletSignatureJSONError | Error parsing Authsig. Please look at the returned error for more info. |
NodePOAPJSONError | Internal error parsing POAP as a JSON. Please try again. If this error persists contact us on Discord. |
NodeCosmosJSONError | Error parsing Cosmos result. Please ensure that the Cosmos condition passed is correct. |
NodeSIWEMessageError | Invalid SIWE message. Please look at the returned error for more info. |
NodeInvalidSIWEResource | Invalid SIWE resource params. Please look at the returned error for more info. |
NodeInvalidSIWESpecialParam | Invalid SIWE special resource params. Please look at the returned error for more info. |
NodeSIWESpecialParamAddressConversionError | The passed SIWE special param ":userAddress" is invalid. Ensure that the passed address is Ethereum compatible. |
NodeInvalidACCReturnValueTest | Invalid returnValueTest. Please look at the returned error for more info. |
NodeRecoveryIdError | Invalid "recovery id" for Cosmos. Please ensure the correctness of the Cosmos Authsig. |
NodeCosmosResponseBodyError | Invalid Cosmos access control conditions. |
NodeMismatchParameters | Number of function params doesn't match the number of the condition params. |
NodeConditionTokenizingError | The substituted param isn't compatible with the function param. Please look at the returned error for more info. |
NodeInvalidConditionTokenType | Invalid comparison with returned EVM token. Please look at the returned error for more info. |
NodeTokenEncodingDecodingError | Error with the accessControlConditions involving EVM token. Please look at the returned error for more info. |
NodeInvalidSolanaRpcMethod | Unsupported Solana RPC method. The ONLY supported solanaRPCMethods are: "getBlock", "getBalance", "getAccountInfo", "getTokenAccountBalance", "getTokenAccountsByDelegate", "getTokenAccountsByOwner", "getHealth". |
NodeInvalidMetaplexCollectionAddress | Incorrect Metaplex collection address. |
NodeSolanaNFTMetadataError | Unable to retrieve metadata for the Solana NFT. Please ensure the correctness of the solRpcConditions. |
NodeTimestampConversionError | Error converting Rate Limiting timestamp to u64. Please try again. If this error persists contact us on Discord. |
NodeOfflinePublicKeyConversionError | Internal error with ECDSA publicKey. Please try again. If this error persists contact us on Discord. |
NodeUpdatePermanentCondition | Can't update permanant encryption condition! |
NodeInvalidUpdatingUser | Only the user can update the encryption condition. You're not the user! |
NodeTooManyConditions | Number of provided accessControlCondition exceeds the maximum permitted value of 30. |
NodeActionNotAllowed | Lit Action isn't allowed to be executed. You have to permit the Lit Action first to execute it on the nodes. |
NodeJsExecutionError | Error executing code on the Lit nodes. Note, the maximum execution time for a code is 1s, the nodes will time out after this. Please try again. If this error persists contact us on Discord. |
NodeBlsNoKeyGenError | Internal error with BLS keygen. Please try again. If this error persists contact us on Discord. |
NodeBlsWrongKeyGenEpochError | Internal error with BLS epoch sync. Please try again AFTER a while. If this error persists contact us on Discord. |
NodeContractFunctionParamsEncodingError | Couldn't encode the provided Authsig into the isValidSignature function. Please ensure that it is compatible with the isValidSignature params. |
NodeContractAuthsigUnauthorized | EIP1271 Authsig failed for the passed Authsig. |
Wallet Error Handling
MetaMask and other wallets throw errors themselves. The format for those exceptions can be found here.
Not finding the answer you're looking for? Share your feedback on these docs by creating an issue in our GitHub Issues and Reports repository or get support by visiting our Support page.