diff options
Diffstat (limited to 'host/lib/deps/rpclib/lib/rpc/rpc_error.cc')
-rw-r--r-- | host/lib/deps/rpclib/lib/rpc/rpc_error.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/host/lib/deps/rpclib/lib/rpc/rpc_error.cc b/host/lib/deps/rpclib/lib/rpc/rpc_error.cc new file mode 100644 index 000000000..dcf3c1cfc --- /dev/null +++ b/host/lib/deps/rpclib/lib/rpc/rpc_error.cc @@ -0,0 +1,24 @@ +#include "rpc/rpc_error.h" +#include <boost/format.hpp> + +namespace rpc { + +rpc_error::rpc_error(std::string const &what_arg, + std::string const &function_name, + RPCLIB_MSGPACK::object_handle o) + : std::runtime_error(what_arg), + func_name_(function_name), + ob_h_(std::move(o)) {} + +std::string rpc_error::get_function_name() const { return func_name_; } + +RPCLIB_MSGPACK::object_handle &rpc_error::get_error() { return ob_h_; } + +timeout::timeout(std::string const &what_arg) : std::runtime_error(what_arg) { + formatted = + str(boost::format("rpc::timeout: %s") % std::runtime_error::what()); +} + +const char *timeout::what() const noexcept { return formatted.data(); } + +} /* rpc */ |