> For the complete documentation index, see [llms.txt](https://docs.belugas.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.belugas.io/comptroller/error-codes.md).

# Error Codes

| Code | Name                            | Description                                                                          |
| ---- | ------------------------------- | ------------------------------------------------------------------------------------ |
| 0    | `NO_ERROR`                      | Not a failure.                                                                       |
| 1    | `UNAUTHORIZED`                  | The sender is not authorized to perform this action.                                 |
| 2    | `COMPTROLLER_MISMATCH`          | Liquidation cannot be performed in markets with different comptrollers.              |
| 3    | `INSUFFICIENT_SHORTFALL`        | The account does not have sufficient shortfall to perform this action.               |
| 4    | `INSUFFICIENT_LIQUIDITY`        | The account does not have sufficient liquidity to perform this action.               |
| 5    | `INVALID_CLOSE_FACTOR`          | The close factor is not valid.                                                       |
| 6    | `INVALID_COLLATERAL_FACTOR`     | The collateral factor is not valid.                                                  |
| 7    | `INVALID_LIQUIDATION_INCENTIVE` | The liquidation incentive is invalid.                                                |
| 8    | `MARKET_NOT_ENTERED`            | The market has not been entered by the account.                                      |
| 9    | `MARKET_NOT_LISTED`             | The market is not currently listed by the comptroller.                               |
| 10   | `MARKET_ALREADY_LISTED`         | An admin tried to list the same market more than once.                               |
| 11   | `MATH_ERROR`                    | A math calculation error occurred.                                                   |
| 12   | `NONZERO_BORROW_BALANCE`        | The action cannot be performed since the account carries a borrow balance.           |
| 13   | `PRICE_ERROR`                   | The comptroller could not obtain a required price of an asset.                       |
| 14   | `REJECTION`                     | The comptroller rejects the action requested by the market.                          |
| 15   | `SNAPSHOT_ERROR`                | The comptroller could not get the account borrows and exchange rate from the market. |
| 16   | `TOO_MANY_ASSETS`               | Attempted to enter more markets than are currently supported.                        |
| 17   | `TOO_MUCH_REPAY`                | Attempted to repay more than is allowed by the protocol.                             |


---

# 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.belugas.io/comptroller/error-codes.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.
