Boost C++ Libraries

PrevUpHomeNext

Function default_error_mapper

boost::taar::jsonrpc::default_error_mapper — The default failure-to-error mapping, by code only.

Synopsis

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


error_info default_error_mapper(taar::failure const & f);

Description

  • A code of the jsonrpc::error category: that code, with the failure's boost::taar::failure::message (or the code's text when the message is empty).

  • A code of Taar's category (argument not found, not convertible, constraint violated, ...): -32602 Invalid params. When the failure's data is an object, data is that object plus "message": text(); otherwise data is the boost::taar::failure::text string.

  • Anything else, including boost::taar::error::unknown_exception (a user's own exception): -32603 Internal error with the failure's message (the exception's what()), or the spec's "Internal error." when it is empty; no data.


PrevUpHomeNext