Skip to main content

status_for

Function status_for 

Source
pub fn status_for(code: ErrorCode) -> StatusCode
Expand description

The HTTP status a failure deserves.

The split that matters is between “the request cannot be answered as written” (422, the caller fixes it) and “the model or its runtime let us down” (5xx, the caller retries). NoLabelMatched sits on the 5xx side deliberately: the request was well-formed, the model simply did not follow the instruction, and that is an operator’s problem — usually the wrong model — not the caller’s.