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

# Query Errors

> Errors from account lookups, ABCI queries, and CosmWasm smart queries.

These errors occur when querying accounts, contracts, or other on-chain resources. CosmJS handles many "not found" cases gracefully by returning `null`, but some queries throw when a value is required.

## Account / Resource Not Found

Methods like `getAccount` and `getDelegation` catch "not found"
gRPC errors internally and return `null` instead of throwing:

```typescript theme={"system"}
const account = await client.getAccount("cosmos1nonexistent...");
// Returns null, does not throw
```

`getContract` does not return `null` — it throws if no contract is found at the
given address.

`getSequence` also throws if the account does not exist because a sequence
number is always required for signing:

```
"Account 'cosmos1...' does not exist on chain. Send some tokens there before trying to query sequence."
```

## ABCI Query Failure

Low-level query failures throw with the code and log from the node:

```
"Query failed with (6): unknown request"
```

## CosmWasm Query Errors

```
"No contract found at address \"cosmos1...\""
"Could not UTF-8 decode smart query response from contract: ..."
"Could not JSON parse smart query response from contract: ..."
```
