Source: FT7 (#308 / PR #311) — F-2。
Severity: medium / Kind: feature-gap / Decision: fix-in-framework。
現状
`htdocs/index.php:47-52` の top-level `\Throwable` catch は `text/plain` で 500 を返す。REST/HTML どちらの caller も同じ平文を受け取り、ADR-0003 envelope も HTML template も使われない。さらに `APP_DEBUG=1` (non-prod default) では raw exception message が response body に漏れる。
やること
- `RouteContext::isAction()` / `isRest()` で分岐し、REST → `ApiFailureEnvelope` (`INTERNAL-ERROR` 等)、HTML → `template/error/500.tpl`
- `template/error/500.tpl` (最低限の Smarty テンプレ) を framework に追加
- `APP_DEBUG` の振る舞いはそのまま (本 issue では「漏れ」自体は議論しない、別 issue 候補)
- `docs/development/error-codes.md` に `INTERNAL-ERROR` 等の catalog 行を追加
受け入れ条件
Source: FT7 (#308 / PR #311) — F-2。
Severity: medium / Kind: feature-gap / Decision: fix-in-framework。
現状
`htdocs/index.php:47-52` の top-level `\Throwable` catch は `text/plain` で 500 を返す。REST/HTML どちらの caller も同じ平文を受け取り、ADR-0003 envelope も HTML template も使われない。さらに `APP_DEBUG=1` (non-prod default) では raw exception message が response body に漏れる。
やること
受け入れ条件