Method DecidedErrorStatus(IMessage)
The error status already decided for an answer, or null when the table above should decide.
The table exists for one case: a controller that returned an error document, which the dispatcher
then wrapped in a success status. It must not reach past that. The controller dispatcher writes its
own verdict when it has one — NotFound 404 for a path no action matches, InternalError
500 for an action that threw — and so does Core, through the controller, when it states a code
(a 503 during an outage, say). None of those strings are in the table, so a mapper that consulted it
anyway turned every one into 400: a missing route told the caller their request was malformed, and
an exception in our own code reached the client as the client's fault.
has always said it the other way round — the status wins where there is one, and the error document
is read only when nobody stated a code.
Read from the two headers the dispatchers write: redbHttp.ResponseCode (the HTTP dispatcher,
and Core through the controller) and status.code (every controller dispatcher, gRPC
included, which writes nothing else).
public static int? DecidedErrorStatus(IMessage answer)