generated from john/python-template
@@ -107,12 +107,16 @@ user-facing envelopes must not carry it. `AppError` therefore separates the two
|
||||
| Field | Audience | Carries root cause | Surfaces |
|
||||
| --- | --- | --- | --- |
|
||||
| `message` | User-facing and API-facing | No | `show_error`, `build_error_envelope` |
|
||||
| `detail` | Internal only | Yes | `format_error_detail` (evidence), logs |
|
||||
| `detail` | Internal only | Yes | `format_error_detail` (evidence), logs, sanitized UI projection only |
|
||||
|
||||
`classify_unexpected_error` builds a generic `message` and puts the exception type and
|
||||
text on `detail`. Anything rendered to a user or serialized into an API envelope must
|
||||
read `message`; anything persisted as provenance or logged may read `detail`.
|
||||
Enforced by `tests/test_errors.py::test_unexpected_error_does_not_leak_filesystem_paths`.
|
||||
read `message`; anything persisted as provenance or logged may read `detail`. When a UI
|
||||
surface needs to show persisted `error_detail`, it must route through a sanitizing
|
||||
projection that preserves the category, suggestion, and error reference while reducing
|
||||
machine-local absolute paths to basenames only.
|
||||
Enforced by `tests/test_errors.py::test_unexpected_error_does_not_leak_filesystem_paths`
|
||||
and `tests/test_error_message_safety.py`.
|
||||
|
||||
## Operator Recovery Guidance
|
||||
|
||||
|
||||
Reference in New Issue
Block a user