Skip to main content

app_api_error_status

Function app_api_error_status 

Source
pub(super) fn app_api_error_status(e: &str) -> StatusCode
Expand description

Classify an app-API or naming error string into an HTTP status. The service layer returns plain String errors, so this matches on text. FORBIDDEN is a 403. “not found” is a 404: a caller holding a stale or unknown id names a missing resource, not a malformed request (SPEC_WINDOW_NAME_API_HARDENING_2026_08_08.md §3.2). Argument errors are a 400. Everything unrecognized is a 500 (genuine service faults, e.g. SQLite write failures). The one classifier for MuxAPI routes here and the naming routes in http_naming.rs.