Why a procedure operation could not be performed. A caller must branch on this — an HTTP handler maps each kind to a different status — which is what earns a structured error here rather than the usual std::string (see CLAUDE.md's no-exceptions mandate, and libs/comm/foe_error.h for the shape). It keeps a string face so forwarding callers are unaffected.
More...
#include <procedure_manager.h>
|
| const std::string & | what () const |
| | Exception-shaped accessor for the message, for call sites that prefer .what().
|
| |
Why a procedure operation could not be performed. A caller must branch on this — an HTTP handler maps each kind to a different status — which is what earns a structured error here rather than the usual std::string (see CLAUDE.md's no-exceptions mandate, and libs/comm/foe_error.h for the shape). It keeps a string face so forwarding callers are unaffected.
Two layers raise these, and the split is worth knowing: ProcedureManager produces only kBusy and kUnknownDevice, because those are the only two things it can judge. Whether a procedure exists and whether a request is valid are the catalogue's business (procedure_catalogue.h) — the manager is told a body, never a name it could validate. One error type across both keeps a handler's mapping in one place instead of translating between two.
◆ Kind
| Enumerator |
|---|
| kBusy | Another procedure is already running on that device. → 409.
|
| kUnknownDevice | No device holds that bus position. → 404.
|
| kUnknownProcedure | No procedure by that name, or not one this device supports. → 404.
|
| kInvalidRequest | The procedure exists but the request for it does not validate. → 400.
|
◆ what()
| const std::string & mm::node::ProcedureError::what |
( |
| ) |
const |
|
inline |
Exception-shaped accessor for the message, for call sites that prefer .what().
◆ kind
◆ message
| std::string mm::node::ProcedureError::message |
The documentation for this struct was generated from the following file: