> For the complete documentation index, see [llms.txt](https://docs.quipuswap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quipuswap.com/smart-contracts/dex-token-edition/exceptions.md).

# Exceptions

In some cases, the contract's execution might fail. The current chapter describes the list of possible in-contract failures.

| Error                    | Description                                                                                                        |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| Dex/reentrancy           | It is prohibited to call the exchange until the previous operation is finished.                                    |
| Dex/function-not-set     | The code for the entrypoint doesn't exist in the bigmap. Should be unreachable.                                    |
| Dex/not-entered          | The contract can't be called until the previous method execution isn't finished.                                   |
| Dex/not-self             | The method should be called by the exchange contract only.                                                         |
| Dex/not-token            | The token doesn't implement the standard entrypoint.                                                               |
| Dex/not-close-entrypoint | The exchange contract doesn't have close entrypoint. Should be unreachable.                                        |
| Dex/not-launched         | The exchange for the pair isn't launched.                                                                          |
| Dex/no-liquidity         | Action can't be performed if there is no liquidity in the pool.                                                    |
| Dex/no-token-a-in        | The amount of invested token A can't be zero.                                                                      |
| Dex/no-token-b-in        | The amount of invested token B can't be zero.                                                                      |
| Dex/pair-exist           | The exchange can't be launched if it already exists.                                                               |
| Dex/wrong-route          | The exchange route isn't cohesive.                                                                                 |
| Dex/zero-amount-in       | Invest of zero tokens on one of the sides is not allowed.                                                          |
| Dex/insufficient-shares  | Not enough shares to burn.                                                                                         |
| Dex/dust-output          | One or all divested token amounts are zero.                                                                        |
| Dex/high-min-out         | The expected output is higher than the possible.                                                                   |
| Dex/wrong-pair-order     | The tokens should be provided in ascending order.                                                                  |
| Dex/empty-route          | The provided exchange route is empty.                                                                              |
| Dex/low-max-token-a-in   | The max amount of token A to deposit for the shares is insufficient.                                               |
| Dex/low-max-token-b-in   | The amount of token B to withdraw for the shares is too low.                                                       |
| Dex/action-outdated      | The operation isn't outdated.                                                                                      |
| Dex/wrong-reserves-state | After divest, some reserves and total shares aren't all zero or aren't all non-zero values. Should be unreachable. |
| Dex/low-supply           | The amount of divested shares is higher than the total supply. Should be unreachable.                              |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.quipuswap.com/smart-contracts/dex-token-edition/exceptions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
