Motion Master 6.0.0-alpha.86
Next-generation motion control software
Loading...
Searching...
No Matches
mm::node::ProcedureError Struct Reference

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>

Collaboration diagram for mm::node::ProcedureError:
[legend]

Public Types

enum class  Kind : uint8_t { kBusy , kUnknownDevice , kUnknownProcedure , kInvalidRequest }
 

Public Member Functions

const std::string & what () const
 Exception-shaped accessor for the message, for call sites that prefer .what().
 

Public Attributes

Kind kind = Kind::kBusy
 
std::string message
 

Detailed Description

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.

Member Enumeration Documentation

◆ Kind

enum class mm::node::ProcedureError::Kind : uint8_t
strong
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.

Member Function Documentation

◆ what()

const std::string & mm::node::ProcedureError::what ( ) const
inline

Exception-shaped accessor for the message, for call sites that prefer .what().

Member Data Documentation

◆ kind

Kind mm::node::ProcedureError::kind = Kind::kBusy

◆ message

std::string mm::node::ProcedureError::message

The documentation for this struct was generated from the following file: