> For the complete documentation index, see [llms.txt](https://vitrina-blogerov.gitbook.io/bloggers-showcase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vitrina-blogerov.gitbook.io/bloggers-showcase/arkhitektura/stranicy-oshibok.md).

# Страницы ошибок

Страницы ошибок показываются, когда пользователь попадает на закрытый путь, несуществующую страницу или когда backend временно недоступен.

<figure><img src="https://2999607467-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FuwCSpQuu1p5soxSClCET%2Fuploads%2FkDceke8AygX0uOQLJQ0s%2Fimage.png?alt=media&amp;token=2a92e922-86a9-4a7b-b7db-7912eb032366" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
В платформе есть два уровня ошибок: edge-ошибки от Caddy и backend-ошибки от FastAPI. Это разные ситуации.
{% endhint %}

### Какие ошибки используются

| Код   | Когда появляется                         |
| ----- | ---------------------------------------- |
| `403` | Доступ запрещен.                         |
| `404` | Страница или путь не найден.             |
| `502` | Caddy не смог получить ответ от backend. |

### Где лежат страницы

{% tabs %}
{% tab title="Edge Caddy" %}

```
/opt/bloggers_platform/edge/www/errors/403.html
/opt/bloggers_platform/edge/www/errors/404.html
/opt/bloggers_platform/edge/www/errors/502.html
```

Эти страницы показывает Caddy.
{% endtab %}

{% tab title="Backend" %}

```
templates/403.html
templates/404.html
templates/502.html
```

Эти страницы находятся внутри языковой версии и могут использоваться backend-уровнем.
{% endtab %}
{% endtabs %}

### Как выбирается страница

```mermaid
flowchart TB
    A["Запрос пользователя"] --> B{"Caddy нашел маршрут?"}
    B -->|нет| C["Edge 404"]
    B -->|да| D{"Backend отвечает?"}
    D -->|нет| E["Edge 502"]
    D -->|да| F["FastAPI"]
    F --> G{"Есть доступ?"}
    G -->|нет| H["403"]
    G -->|да| I["Страница или API-ответ"]
```

### Важно

<details>

<summary>Если на несуществующем пути белый экран</summary>

Чаще всего это значит, что страница ошибок загрузилась, но не подтянула стили или фон. Нужно проверить абсолютные пути к `/assets/style.css` и `/assets/bg.mp4`.

</details>

<details>

<summary>Если видно стандартную ошибку Caddy</summary>

Значит Caddy не нашел или не смог отдать branded-страницу из `/errors`. Проверьте папку `/opt/bloggers_platform/edge/www/errors`.

</details>

<details>

<summary>Если появилась 502</summary>

Проверьте контейнер backend нужной языковой версии и общий edge:

```bash
sudo /opt/bloggers_platform/apps/ru/manager.sh status
sudo /opt/bloggers_platform/manager.sh status
```

</details>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://vitrina-blogerov.gitbook.io/bloggers-showcase/arkhitektura/stranicy-oshibok.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
