Boost C++ Libraries

PrevUpHomeNext

Function make_error_response

boost::taar::jsonrpc::make_error_response — Convenience overload using the error enum.

Synopsis

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


boost::json::value 
make_error_response(boost::json::value id, error code, std::string message, 
                    std::optional< boost::json::value > data = std::nullopt);

Description

Callers that want the spec's default message for the code can pass boost::taar::jsonrpc::error_category().message(static_cast<int>(code)) – kept out of the overload set to avoid an ambiguity between "default-message + data" and "explicit message" when the third argument is a string literal.


PrevUpHomeNext