|
morph 0.1.0
Asynchronous bridge between GUI thread and business models
|
Thrown when a decoded action fails ActionValidator<Action>::ready(...) on a server-side or local execution path, before Model::execute runs. More...
#include <registry.hpp>
Public Member Functions | |
| ValidationError (std::string_view modelType, std::string_view actionType) | |
| Constructs the error with a message of the form "action failed validation: <modelType>/<actionType>". | |
Thrown when a decoded action fails ActionValidator<Action>::ready(...) on a server-side or local execution path, before Model::execute runs.
Raised by morph::model::detail::ActionDispatcher::registerAction's runner (the server dispatch path used by RemoteServer, every remote and Qt WebSocket topology) and by Bridge::executeVia's localOp (the in-process path used by LocalBackend) — the two sites an action can reach ungated: the runner by a hand-built envelope from an untrusted remote client, localOp by an action built by hand and handed to BridgeHandler::execute<Action>(). An action that did pass morph::flows::FlowSession::set<>'s gate (forms/flows.hpp) or the type-erased executeJson gate (ActionExecuteRegistry::registerAction) still reaches whichever of the two its topology dispatches through — FlowSession::fireStep goes through the handler like any other caller — and is simply re-checked there.
Deriving from std::runtime_error means existing catch (const std::exception&) handling — e.g. RemoteServer::dispatchExecute's strand catch, which turns any thrown exception into an err reply — keeps working unchanged; callers that care can catch/dynamic_cast the specific type instead.
Definition at line 345 of file registry.hpp.
|
inline |
Constructs the error with a message of the form "action failed validation: <modelType>/<actionType>".
| modelType | ModelTraits<Model>::typeId() of the target model. |
| actionType | ActionTraits<Action>::typeId() of the rejected action. |
Definition at line 350 of file registry.hpp.