Skip to content

Conversation

@laviniat1996
Copy link
Collaborator

closes #1022

This doc adds all error codes I could find in the codebase for API v2.

@github-actions

This comment was marked as resolved.

@verytactical verytactical added the 3p Reviewed by someone else (a third party). Used for filtering PRs. Don't mind this. label Nov 28, 2025
@verytactical
Copy link
Collaborator

Please ping when it's ready for final editing.

@novusnota
Copy link
Collaborator

/review

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates here—on ecosystem/api/toncenter/v2-errors.mdx: there are several suggestions around formatting and wording; please apply the inline suggestions.

Comment on lines 7 to 16
| Status | Meaning |
| ------ | --------------------------------------------------- |
| 404 | Data not found |
| 405 | Wrong HTTP method (use GET or POST) |
| 409 | Resource exists but wrong type |
| 422 | Invalid request parameters |
| 429 | Rate limit exceeded |
| 500 | Server-side failure |
| 504 | Timeout waiting for liteserver |
| 542 | Liteserver-specific error or unsupported stack type |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[HIGH] HTTP status codes not formatted as code literals

In the overview table, HTTP status codes such as 404, 405, 422, 429, 500, 504, and 542 are rendered as plain text instead of code literals. The extended style guide requires code, paths, and other literal values that developers copy or compare programmatically to use code formatting, and HTTP status codes fall into this category. Leaving them unformatted makes it harder to visually distinguish code-like tokens and is inconsistent with other parts of the documentation. Similar unformatted status codes appear in other tables in this file and should be updated consistently.

Suggested change
| Status | Meaning |
| ------ | --------------------------------------------------- |
| 404 | Data not found |
| 405 | Wrong HTTP method (use GET or POST) |
| 409 | Resource exists but wrong type |
| 422 | Invalid request parameters |
| 429 | Rate limit exceeded |
| 500 | Server-side failure |
| 504 | Timeout waiting for liteserver |
| 542 | Liteserver-specific error or unsupported stack type |
| Status | Meaning |
| ------ | --------------------------------------------------- |
| `404` | Data not found |
| `405` | Wrong HTTP method (use GET or POST) |
| `409` | Resource exists but wrong type |
| `422` | Invalid request parameters |
| `429` | Rate limit exceeded |
| `500` | Server-side failure |
| `504` | Timeout waiting for liteserver |
| `542` | Liteserver-specific error or unsupported stack type |

Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!

| 504 | Timeout waiting for liteserver |
| 542 | Liteserver-specific error or unsupported stack type |

---

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[HIGH] Horizontal rules used instead of headings/whitespace

The file uses a Markdown thematic break (---) in the content body at line 18, in addition to the frontmatter delimiters at lines 1 and 3. The style guide restricts --- to YAML frontmatter and requires using headings, whitespace, or components such as <Aside> to separate sections. Similar separators appear later in the file (for example around the task sections), so the current pattern encourages further misuse of horizontal rules. This makes the document structure less consistent with the rest of the docs and harder to maintain.

Suggested change
---

Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!

Comment on lines 26 to 31
| Status | Error | Fix |
| ------ | -------------------------------- | ----------------------------------------------- |
| 422 | `empty boc` | Include a non-empty `boc` field in request body |
| 429 | `Ratelimit exceeded` | Back off and retry |
| 500 | `Exit code <N> != 0` | Transaction simulation failed, check your BoC |
| 504 | `LITE_SERVER_NETWORK timeout...` | Liteserver didn't respond in time, retry |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[HIGH] Error messages use code font instead of quotation marks

In the “Sending transactions” table, literal error message strings such as empty boc, Ratelimit exceeded, Exit code <N> != 0, and LITE_SERVER_NETWORK timeout... are formatted as code spans in the Error column. The style guide’s rule for quotation marks and error strings requires verbatim log and error messages to be presented in quotation marks, not as code, to match how they appear in logs and improve grep-ability. Using code styling here blurs the distinction between log text and actual code or parameter names. The same pattern of backtick-formatted error strings recurs throughout the other error tables in this file and should be corrected consistently.

Suggested change
| Status | Error | Fix |
| ------ | -------------------------------- | ----------------------------------------------- |
| 422 | `empty boc` | Include a non-empty `boc` field in request body |
| 429 | `Ratelimit exceeded` | Back off and retry |
| 500 | `Exit code <N> != 0` | Transaction simulation failed, check your BoC |
| 504 | `LITE_SERVER_NETWORK timeout...` | Liteserver didn't respond in time, retry |
| Status | Error | Fix |
| ------ | -------------------------------- | ----------------------------------------------- |
| 422 | "empty boc" | Include a non-empty `boc` field in request body |
| 429 | "Ratelimit exceeded" | Back off and retry |
| 500 | "Exit code <N> != 0" | Transaction simulation failed, check your BoC |
| 504 | "LITE_SERVER_NETWORK timeout..." | Liteserver didn't respond in time, retry |

Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!

Copy link
Collaborator Author

@laviniat1996 laviniat1996 Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error messages should stay in code font

| ------ | -------------------------------- | ----------------------------------------------- |
| 422 | `empty boc` | Include a non-empty `boc` field in request body |
| 429 | `Ratelimit exceeded` | Back off and retry |
| 500 | `Exit code <N> != 0` | Transaction simulation failed, check your BoC |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[HIGH] Second‑person pronoun “your” addressing the reader

The Fix text for the Exit code <N> != 0 row in the “Sending transactions” table says “Transaction simulation failed, check your BoC” at line 30. The documentation style guide bans second‑person pronouns such as “you” and “your” in order to keep tone neutral and impersonal. Leaving this phrasing in place makes the entry inconsistent with the rest of the documentation and violates the pronoun rules.

Suggested change
| 500 | `Exit code <N> != 0` | Transaction simulation failed, check your BoC |
| 500 | `Exit code <N> != 0` | Transaction simulation failed, check the BoC |

Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!

Comment on lines 41 to 49
| 404 | `transaction not found` | No matching transaction exists for that source/destination/lt |
| 422 | `failed to parse address` | Address format is invalid |
| 422 | `failed to parse hash` | Hash format is invalid |
| 422 | `failed to parse lt` / `failed to parse created_lt` | Not a valid 64-bit integer |
| 422 | `lt should be non-negative` / `created_lt should be non-negative` | Value can't be negative |
| 422 | `lt and hash should be used together` | Provide both or neither |
| 422 | `empty source address` / `empty destination address` | Required parameter is missing |
| 422 | `limit should be positive` | Must be ≥ 1 |
| 422 | `limit should be less or equal 1000` | Max is 1000 |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[HIGH] Error strings formatted as code instead of quoted log messages

Literal API error messages in the tables are formatted as inline code spans (wrapped in backticks) instead of as quoted strings. For example, in the “Querying transactions” table at lines 41–49, messages such as transaction not found, failed to parse address, and lt should be non-negative are shown in code font rather than in double quotation marks. The style guide requires log and error messages to be presented verbatim in quotes so they are clearly recognizable as returned text and easy to copy. The same pattern appears earlier in the file (for example empty boc, Ratelimit exceeded) and should be updated consistently.

Suggested change
| 404 | `transaction not found` | No matching transaction exists for that source/destination/lt |
| 422 | `failed to parse address` | Address format is invalid |
| 422 | `failed to parse hash` | Hash format is invalid |
| 422 | `failed to parse lt` / `failed to parse created_lt` | Not a valid 64-bit integer |
| 422 | `lt should be non-negative` / `created_lt should be non-negative` | Value can't be negative |
| 422 | `lt and hash should be used together` | Provide both or neither |
| 422 | `empty source address` / `empty destination address` | Required parameter is missing |
| 422 | `limit should be positive` | Must be ≥ 1 |
| 422 | `limit should be less or equal 1000` | Max is 1000 |
| 404 | "transaction not found" | No matching transaction exists for that source/destination/lt |
| 422 | "failed to parse address" | Address format is invalid |
| 422 | "failed to parse hash" | Hash format is invalid |
| 422 | "failed to parse lt" / "failed to parse created_lt" | Not a valid 64-bit integer |
| 422 | "lt should be non-negative" / "created_lt should be non-negative" | Value can't be negative |
| 422 | "lt and hash should be used together" | Provide both or neither |
| 422 | "empty source address" / "empty destination address" | Required parameter is missing |
| 422 | "limit should be positive" | Must be ≥ 1 |
| 422 | "limit should be less or equal 1000" | Max is 1000 |

Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!

Copy link
Collaborator Author

@laviniat1996 laviniat1996 Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error messages should stay in code font

@novusnota novusnota marked this pull request as draft November 28, 2025 18:18
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates in ecosystem/api/toncenter/v2-errors.mdx: I have one inline suggestion there, please apply the inline suggestion to align with the documented conventions.

Comment on lines +24 to +45
| Status | Error | Fix |
| ------ | -------------------------------- | ----------------------------------------------- |
| `422` | `empty boc` | Include a non-empty `boc` field in request body |
| `429` | `Ratelimit exceeded` | Back off and retry |
| `500` | `Exit code <N> != 0` | Transaction simulation failed, check the BoC |
| `504` | `LITE_SERVER_NETWORK timeout...` | Liteserver didn't respond in time, retry |

### Querying transactions

**Endpoints:** `/api/v2/getTransactions`, `/api/v2/tryLocateTx`, `/api/v2/tryLocateResultTx`, `/api/v2/tryLocateSourceTx`

| Status | Error | Fix |
| ------ | ----------------------------------------------------------------- | ------------------------------------------------------------- |
| `404` | `transaction not found` | No matching transaction exists for that source/destination/lt |
| `422` | `failed to parse address` | Address format is invalid |
| `422` | `failed to parse hash` | Hash format is invalid |
| `422` | `failed to parse lt` / `failed to parse created_lt` | Not a valid 64-bit integer |
| `422` | `lt should be non-negative` / `created_lt should be non-negative` | Value can't be negative |
| `422` | `lt and hash should be used together` | Provide both or neither |
| `422` | `empty source address` / `empty destination address` | Required parameter is missing |
| `422` | `limit should be positive` | Must be ≥ 1 |
| `422` | `limit should be less or equal 1000` | Max is 1000 |
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[HIGH] Error messages use code spans instead of quotation marks

In the API v2 error tables, literal error strings (for example, empty boc, transaction not found, and related messages in the “Error” column) are formatted as inline code spans instead of being wrapped in quotation marks. The style guide explicitly requires log messages and error strings to appear verbatim in quotation marks and marks this as a HIGH-severity rule, while reserving code formatting for error codes/identifiers (see https://github.com/ton-org/docs/blob/main/contribute/style-guide-extended.mdx?plain=1#L276-L295). Presenting these messages as code spans makes it harder to grep for exact strings and diverges from the mandated quoting convention. The same pattern repeats across the other error tables in this file and should be normalized consistently.

Please leave a reaction 👍/👎 to this suggestion to improve future reviews for everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3p Reviewed by someone else (a third party). Used for filtering PRs. Don't mind this.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TON Center > API/v2 > Responses and errors]

4 participants