JSON error body matching `FastAPI`'s `HTTPException` shape, which the UIs' error paths already understand.
(detail: &str)
| 138 | /// JSON error body matching `FastAPI`'s `HTTPException` shape, which the UIs' |
| 139 | /// error paths already understand. |
| 140 | pub(crate) fn http_detail(detail: &str) -> Value { |
| 141 | json!({ "detail": detail }) |
| 142 | } |
| 143 | |
| 144 | pub(crate) fn json_error(status: StatusCode, detail: impl Into<String>) -> JsonError { |
| 145 | (status, Json(http_detail(&detail.into()))) |
no outgoing calls
no test coverage detected