iceberg-cpp
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
iceberg::rest::DefaultErrorHandler Class Reference

Default error handler for REST API responses. More...

#include <error_handlers.h>

Inheritance diagram for iceberg::rest::DefaultErrorHandler:
iceberg::rest::ErrorHandler iceberg::rest::ConfigErrorHandler iceberg::rest::NamespaceErrorHandler iceberg::rest::PlanErrorHandler iceberg::rest::PlanTaskErrorHandler iceberg::rest::TableCommitErrorHandler iceberg::rest::TableErrorHandler iceberg::rest::ViewCommitErrorHandler iceberg::rest::ViewErrorHandler

Public Member Functions

Status Accept (const ErrorResponse &error) const override
 Process an error response and return an appropriate Error.
 
Result< ErrorResponseParseResponse (uint32_t code, const std::string &text) const override
 Parse an HTTP error response body.
 

Static Public Member Functions

static const std::shared_ptr< DefaultErrorHandler > & Instance ()
 Returns the singleton instance.
 

Detailed Description

Default error handler for REST API responses.

Member Function Documentation

◆ Accept()

Status iceberg::rest::DefaultErrorHandler::Accept ( const ErrorResponse error) const
overridevirtual

Process an error response and return an appropriate Error.

Parameters
errorThe error response parsed from the HTTP response body
Returns
An Error object with appropriate ErrorKind and message

Implements iceberg::rest::ErrorHandler.

Reimplemented in iceberg::rest::NamespaceErrorHandler, iceberg::rest::DropNamespaceErrorHandler, iceberg::rest::TableErrorHandler, iceberg::rest::TableCommitErrorHandler, iceberg::rest::ViewErrorHandler, iceberg::rest::ViewCommitErrorHandler, iceberg::rest::PlanErrorHandler, and iceberg::rest::PlanTaskErrorHandler.

◆ ParseResponse()

Result< ErrorResponse > iceberg::rest::DefaultErrorHandler::ParseResponse ( uint32_t  code,
const std::string &  text 
) const
overridevirtual

Parse an HTTP error response body.

Parameters
codeThe HTTP status code from the failed response
textThe HTTP response body
Returns
The parsed error response

Implements iceberg::rest::ErrorHandler.


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