> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inco.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Error Reference

> Custom errors thrown by the Inco Lightning smart contracts

This page lists every custom error that a dApp developer may encounter when building on Inco Lightning.

***

## Access Control

### `SenderNotAllowedForHandle`

```solidity theme={null}
error SenderNotAllowedForHandle(bytes32 handle, address sender);
```

The caller does not have read or use permission on this handle. Grant access first with `e.allow(handle, address)` or `inco.allow(handle, address)`.

### `SharerNotAllowedForHandle`

```solidity theme={null}
error SharerNotAllowedForHandle(bytes32 handle, address sharer);
```

The sharer does not hold permission on this handle and therefore cannot delegate access to others.

### `HandleAlreadyExists`

```solidity theme={null}
error HandleAlreadyExists(bytes32 handle);
```

An attempt was made to register a handle that already exists in the access control list.

### `ProofVerificationFailed`

```solidity theme={null}
error ProofVerificationFailed(address verifyingContract, bytes4 callFunction, bytes argData);
```

The session verifier contract did not return `ALLOWANCE_GRANTED_MAGIC_VALUE`. The allowance proof failed — check that the voucher is valid and has not expired or been revoked.

### `InvalidVoucherWarning`

```solidity theme={null}
error InvalidVoucherWarning();
```

Thrown when a voucher's warning field does not match the required warning text

### `InvalidVoucherSignature`

```solidity theme={null}
error InvalidVoucherSignature(address signer, bytes32 digest, bytes signature);
```

The allowance voucher signature does not match the sharer's address.

### `InvalidVoucherSessionNonce`

```solidity theme={null}
error InvalidVoucherSessionNonce(bytes32 providedSessionNonce, bytes32 activeSessionNonce);
```

The voucher was signed under a session nonce that no longer matches the sharer's active nonce. The voucher has been revoked via `updateActiveVouchersSessionNonce`.

### `InvalidVerifyingContract`

```solidity theme={null}
error InvalidVerifyingContract();
```

The voucher specifies a zero-address verifying contract, which is not allowed.

***

## Encrypted Input

### `InvalidInputVersion`

```solidity theme={null}
error InvalidInputVersion(uint16 version);
```

The ciphertext input uses an unsupported version number.

### `InputLengthTooShort`

```solidity theme={null}
error InputLengthTooShort(uint256 length);
```

The input bytes are too short to be a valid encrypted input.

### `ExternalHandleDoesNotMatchComputedHandle`

```solidity theme={null}
error ExternalHandleDoesNotMatchComputedHandle(
    bytes32 externalHandle,
    bytes32 computedHandle,
    uint256 chainId,
    address aclAddress,
    address userAddress,
    address contractAddress,
    uint16 version
);
```

The handle supplied by the user does not match the handle derived from the ciphertext content. This indicates the input data was constructed incorrectly or tampered with.

***

## Decryption & Attestation

### `HandleMismatch`

```solidity theme={null}
error HandleMismatch();
```

A decryption or computation attestation was submitted for a different handle than the one the contract expects. Always verify `decryption.handle` explicitly before accepting an attestation — see [Best Practices](./best-practices).

### `InvalidTEEAttestation`

```solidity theme={null}
error InvalidTEEAttestation();
```

The attestation signatures are invalid or fail TEE verification.

### `UnexpectedDecryptedValue`

```solidity theme={null}
error UnexpectedDecryptedValue();
```

The decrypted value does not match the expected value in a computation attestation.

### `AttestationsSignaturesLengthMismatch`

```solidity theme={null}
error AttestationsSignaturesLengthMismatch(uint256 attestationsLength, uint256 signaturesLength);
```

The `attestations` and `signatures` arrays passed to a batch verification call have different lengths.

***

## EList Operations

### `IndexOutOfRange`

```solidity theme={null}
error IndexOutOfRange(uint16 i, uint16 len);
```

An index access on an elist is beyond the list bounds.

### `SliceOutOfRange`

```solidity theme={null}
error SliceOutOfRange(uint16 start, uint16 end, uint16 len);
```

The requested slice boundaries exceed the list length.

### `InvalidRange`

```solidity theme={null}
error InvalidRange(uint16 start, uint16 end);
```

The start index is greater than or equal to the end index.

### `ListRangeExceedsType`

```solidity theme={null}
error ListRangeExceedsType(uint16 end, ETypes listType);
```

The end value of a range operation does not fit within the bit width of the specified list type.

### `ZeroLength`

```solidity theme={null}
error ZeroLength();
```

An operation that requires a non-empty list received an empty one.

### `ListTooLong`

```solidity theme={null}
error ListTooLong(uint32 provided, uint16 max);
```

The list exceeds the maximum allowed length.

### `ListTypeMismatch`

```solidity theme={null}
error ListTypeMismatch(ETypes lhs, ETypes rhs);
```

Two lists have incompatible element types (for example, concatenating a `Uint256` list with a `Bool` list).

### `UnsupportedListType`

```solidity theme={null}
error UnsupportedListType(ETypes listType);
```

The specified element type is not supported for this elist operation.

***

## Type System

### `UnsupportedType`

```solidity theme={null}
error UnsupportedType(ETypes actual);
```

The handle type is not supported for this operation.

### `UnexpectedType`

```solidity theme={null}
error UnexpectedType(ETypes actual, bytes32 expectedTypes);
```

The handle type does not match any of the expected types. `expectedTypes` is a bitmask of the valid types.

### `SameTypeCast`

```solidity theme={null}
error SameTypeCast(ETypes t);
```

A cast was attempted from a type to itself. Use a different target type.

***

## Fees

### `FeeNotPaid`

```solidity theme={null}
error FeeNotPaid();
```

The `msg.value` sent with the transaction was insufficient to cover the required fee. Query `inco.getFee()` to determine the correct amount before calling.

### `FeeWithdrawalFailed`

```solidity theme={null}
error FeeWithdrawalFailed();
```

The ETH transfer during fee withdrawal failed.

### `NoFeesToWithdraw`

```solidity theme={null}
error NoFeesToWithdraw();
```

A withdrawal was attempted when there are no accumulated fees available.

***

## ETH Transfer

### `EthInboundTransferUnsupported`

```solidity theme={null}
error EthInboundTransferUnsupported();
```

Plain ETH transfers directly to the `IncoLightning` contract are rejected. Always attach `msg.value` to a specific function call to pay fees.

### `RefundFailed`

```solidity theme={null}
error RefundFailed();
```

An ETH refund transfer back to the caller failed.

### `ReentrantCall`

```solidity theme={null}
error ReentrantCall();
```

A reentrant call was detected and blocked.
