# errors

## Classes

| Class | Description |
| ------ | ------ |
| [AuthenticationError](/reference/filoz/filecoin-encryption-envelope/namespaces/errors/classes/authenticationerror/) | AEAD authentication failed. A wrong key and modified authenticated data are intentionally reported as the same error. |
| [ChunkCountExceededError](/reference/filoz/filecoin-encryption-envelope/namespaces/errors/classes/chunkcountexceedederror/) | A chunk count derived from a plaintext or ciphertext length exceeds `MAX_CHUNK_COUNT`. |
| [CriticalHeaderError](/reference/filoz/filecoin-encryption-envelope/namespaces/errors/classes/criticalheadererror/) | A `crit` (label 2) listing was rejected — wrong bucket, wrong shape, or naming a label this profile does not understand or does not actually carry. |
| [CryptoOperationError](/reference/filoz/filecoin-encryption-envelope/namespaces/errors/classes/cryptooperationerror/) | A cryptographic runtime operation failed for a reason other than authentication. |
| [EnvelopeError](/reference/filoz/filecoin-encryption-envelope/namespaces/errors/classes/envelopeerror/) | Base class for every error raised by this package. |
| [InvalidChunkSizeError](/reference/filoz/filecoin-encryption-envelope/namespaces/errors/classes/invalidchunksizeerror/) | `chunkSize` is not an integer within `[MIN_CHUNK_SIZE, MAX_CHUNK_SIZE]`. |
| [InvalidCiphertextLengthError](/reference/filoz/filecoin-encryption-envelope/namespaces/errors/classes/invalidciphertextlengtherror/) | The ciphertext length cannot represent a valid object for the selected scheme. |
| [InvalidKeyError](/reference/filoz/filecoin-encryption-envelope/namespaces/errors/classes/invalidkeyerror/) | A CEK or KEK is not a 32-byte, non-zero AES-256 key. |
| [InvalidNonceError](/reference/filoz/filecoin-encryption-envelope/namespaces/errors/classes/invalidnonceerror/) | A base nonce, chunk index, or last-chunk flag is not valid for per-chunk nonce derivation. |
| [InvalidPlaintextError](/reference/filoz/filecoin-encryption-envelope/namespaces/errors/classes/invalidplaintexterror/) | Plaintext supplied to an encryption operation is not a byte string. |
| [InvalidPlaintextLengthError](/reference/filoz/filecoin-encryption-envelope/namespaces/errors/classes/invalidplaintextlengtherror/) | `plaintextLength` is not a non-negative safe integer or exceeds the limit for the selected scheme or encoded layout. |
| [MalformedEnvelopeError](/reference/filoz/filecoin-encryption-envelope/namespaces/errors/classes/malformedenvelopeerror/) | The envelope, or a value destined for one, does not match this package's wire profile. Raised on both paths: by encode when a caller's input would produce bytes this package could not read back, and by decode on anything the profile forbids. |
| [NoUsableRecipientError](/reference/filoz/filecoin-encryption-envelope/namespaces/errors/classes/nousablerecipienterror/) | No recipient in a valid envelope could provide a CEK. |
| [RecipientAttemptLimitError](/reference/filoz/filecoin-encryption-envelope/namespaces/errors/classes/recipientattemptlimiterror/) | A recipient unwrapper reached its configured limit of key-unwrap attempts. |
| [RecipientUnwrapError](/reference/filoz/filecoin-encryption-envelope/namespaces/errors/classes/recipientunwraperror/) | A recipient unwrapper failed instead of declining the available recipients. |
| [UnsupportedSchemeError](/reference/filoz/filecoin-encryption-envelope/namespaces/errors/classes/unsupportedschemeerror/) | The protected header's `alg` is not one of the schemes this package implements (`ALG_AES_256_GCM` or `ALG_CHUNKED_AES_256_GCM_STREAM`). |