Skip to content

The SDK checks your input before it sends anything, so most mistakes throw a specific error with a message that names the problem. Check for one with instanceof. Errors from the node arrive as EntityMutationError for writes and QueryError for queries.

Every error below is exported from @arkiv-network/sdk, except the three query errors, which come from @arkiv-network/sdk/query.

ErrorThrown when
EntityMutationErrorThe transaction failed or reverted, for example because the account isn’t the owner or has no tGLM. txHash holds the transaction, if it was sent
SchemaMismatchErrorA value is missing, names a column the schema doesn’t have, or has the wrong type
InvalidValueErrorA value doesn’t fit its type: out of range, wrong length, bad checksum, too many decimal places
UntypedValueErrorA value is neither a typed value nor a plain boolean, number, bigint, string or Uint8Array
MissingValueErrorA value is null. Leave the column out, or unset it in a patch
EntityTooLargeErrorThe bytes values of one create or patch add up to more than 128 KiB
EmptyPatchErrorA patch has nothing to set or unset
ConflictingMutationErrorA patch sets and unsets the same column
InvalidExpiryErrorAn expiration is in the past, longer than the maximum lifetime of about 182 days, or not a whole number of blocks
InvalidCreationFlagsErrorA creation flag isn’t a boolean
InvalidSaltErrorA salt is negative or wider than 128 bits
NoRandomSourceErrorThe runtime has no crypto.getRandomValues to make a random salt
ErrorThrown when
NoEntityFoundErrorgetEntity found no live entity with the key. entityKey holds the key
SchemaMismatchErrorAn entity read through a schema lacks a selected required column, holds a value of another type, or has another schema’s tag. Thrown by getEntity, and by a query with onMismatch: "throw". Queries skip such entities by default
UnknownAttributeTypeErrorThe node returned an attribute type this SDK version can’t decode. Update the SDK
InvalidPredicateErrorA condition names an attribute that isn’t an indexed column of the schema, a sort key names a bytes column or one the schema doesn’t have, either uses the wrong type, between has bounds of two types, a sort key has no type in a query without a schema, orderBy gets more than one key, or the query has no condition at all
UnsupportedOperatorErrorstartsWith was given a value that isn’t a str
QueryErrorThe node rejected the query. kind says why: see query language errors
ErrorThrown when
MissingAccessKeyErrorrabdi was called with an invalid accessKey. Pass a key, or "" for the rate-limited public RPC
ErrorThrown when
InvalidAttributeNameErrorA column name breaks the naming rules
SchemaDefinitionErrorThe schema name isn’t a valid str, an entry isn’t a column, or a column is named arkiv.schema
TooManyAttributesErrorA schema has more columns than one entity can hold