Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
web::ng::impl::ErrorHelper Class Reference

A helper that attempts to match rippled reporting mode HTTP errors as close as possible. More...

#include <ErrorHandling.hpp>

Public Member Functions

 ErrorHelper (Request const &rawRequest, std::optional< boost::json::object > request=std::nullopt)
 Construct a new Error Helper object.
 
Response makeError (rpc::Status const &err) const
 Make an error response from a status.
 
Response makeInternalError () const
 Make an internal error response.
 
Response makeNotReadyError () const
 Make a response for when the server is not ready.
 
Response makeTooBusyError () const
 Make a response for when the server is too busy.
 
Response makeJsonParsingError () const
 Make a response when json parsing fails.
 
boost::json::object composeError (rpc::Status const &error) const
 
boost::json::object composeError (rpc::RippledError error) const
 Compose an error into json object from a rippled error.
 

Detailed Description

A helper that attempts to match rippled reporting mode HTTP errors as close as possible.

Constructor & Destructor Documentation

◆ ErrorHelper()

web::ng::impl::ErrorHelper::ErrorHelper ( Request const & rawRequest,
std::optional< boost::json::object > request = std::nullopt )

Construct a new Error Helper object.

Parameters
rawRequestThe request that caused the error.
requestThe parsed request that caused the error.

Member Function Documentation

◆ composeError() [1/2]

boost::json::object web::ng::impl::ErrorHelper::composeError ( rpc::RippledError error) const
nodiscard

Compose an error into json object from a rippled error.

Parameters
errorThe rippled error to compose into a json object.
Returns
The composed json object.

◆ composeError() [2/2]

boost::json::object web::ng::impl::ErrorHelper::composeError ( rpc::Status const & error) const
nodiscard

@beirf Compose an error into json object from a status.

Parameters
errorThe status to compose into a json object.
Returns
The composed json object.

◆ makeError()

Response web::ng::impl::ErrorHelper::makeError ( rpc::Status const & err) const
nodiscard

Make an error response from a status.

Parameters
errThe status to make an error response from.
Returns

◆ makeInternalError()

Response web::ng::impl::ErrorHelper::makeInternalError ( ) const
nodiscard

Make an internal error response.

Returns
A response with an internal error.

◆ makeJsonParsingError()

Response web::ng::impl::ErrorHelper::makeJsonParsingError ( ) const
nodiscard

Make a response when json parsing fails.

Returns
A response with a json parsing error.

◆ makeNotReadyError()

Response web::ng::impl::ErrorHelper::makeNotReadyError ( ) const
nodiscard

Make a response for when the server is not ready.

Returns
A response with a not ready error.

◆ makeTooBusyError()

Response web::ng::impl::ErrorHelper::makeTooBusyError ( ) const
nodiscard

Make a response for when the server is too busy.

Returns
A response with a too busy error.

The documentation for this class was generated from the following files: