Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
Errors.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include <boost/json/object.hpp>
5#include <rpcspec/Errors.hpp>
6
7#include <optional>
8#include <string_view>
9
10namespace rpc {
11
16 ClioError const code;
17 std::string_view const error;
18 std::string_view const message;
19};
20
27ClioErrorInfo const&
28getErrorInfo(ClioError code);
29
36boost::json::object
37makeError(Status const& status);
38
47boost::json::object
49 XrpldError err,
50 std::optional<std::string_view> customError = std::nullopt,
51 std::optional<std::string_view> customMessage = std::nullopt
52);
53
62boost::json::object
64 ClioError err,
65 std::optional<std::string_view> customError = std::nullopt,
66 std::optional<std::string_view> customMessage = std::nullopt
67);
68
69} // namespace rpc
This namespace contains all the RPC logic and handlers.
Definition AMMHelpers.cpp:17
ClioErrorInfo const & getErrorInfo(ClioError code)
Get the error info object from an clio-specific error code.
Definition Errors.cpp:86
boost::json::object makeError(XrpldError err, std::optional< std::string_view > customError, std::optional< std::string_view > customMessage)
Generate JSON from a rpc::XrpldError.
Definition Errors.cpp:185
Holds info about a particular ClioError.
Definition Errors.hpp:15