Boost C++ Libraries

PrevUpHomeNext

Type definition tool_error_handler

tool_error_handler — Maps a failed tool call to the isError text, or nullopt for a protocol error.

Synopsis

// In header: <boost/taar/mcp/endpoint.hpp>


typedef std::function< std::optional< std::string >(taar::failure const &)> tool_error_handler;

Description

Invoked as handler(taar::failure const&); the endpoint wraps what the tool threw with boost::taar::failure::from_exception once. A nullopt answer sends a JSON-RPC error built by the JSON-RPC error mapper (see jsonrpc::endpoint::set_error_mapper).


PrevUpHomeNext