- Add docs/README.md as the index of all documentation. - Split the 52 DEC entries of decisioni-e-limiti.md into docs/adr/ADR-NN files (same numbers), add ADR-53 (audit log), TEMPLATE.md and an ADR index with a feature -> ADR table. - Rename decisioni-e-limiti.md to limiti-noti.md (LIM only) and rewrite all DEC-nn references as links to the ADRs. - Document the docs-first / SSOT / ADR rules in processo-di-modifica.md and map the docs in CLAUDE.md and README.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
20 lines
1.0 KiB
Markdown
20 lines
1.0 KiB
Markdown
# ADR-47 — L'API parla una sola lingua e risponde con codici
|
|
|
|
- **Stato:** Accettata
|
|
- **Area:** Interfacce, API e lingue
|
|
- **Fonte di verità per:** la scelta di progetto descritta qui sotto; i requisiti (`PREFISSO-NN`) che la attuano stanno nei documenti di dominio, indicati nelle *Conseguenze*.
|
|
|
|
## Decisione
|
|
|
|
**L'API parla una sola lingua e risponde con codici.** Ogni
|
|
errore rivolto all'utente ha `detail = {code, message, params}`: `message` è
|
|
in inglese per chi non usa la dashboard, `code` è ciò che il frontend traduce
|
|
(`error.<code>`), `params` porta i valori (gli importi come `*_sats`). Anche
|
|
l'errore 500 generico ha questa forma (`internal_error`) e non espone il
|
|
testo dell'eccezione.
|
|
- *Conseguenze:* aggiungere un errore significa dargli un codice e
|
|
aggiungere `error.<code>` in tutte le 7 lingue (vedi [api.md](../api.md)).
|
|
|
|
*Codice:* `app/api/errors.py:ApiError` · `app/api/errors.py:http_error` · `app/main.py:log_unhandled_exception` ·
|
|
*Test:* `tests/unit/test_rounds_route.py::test_unhandled_errors_use_the_structured_detail_shape`
|