kaycxx-http
HTTP client library
Loading...
Searching...
No Matches
kaycxx::http::response_error Class Reference

Exception thrown when a server responds with a non-success status code. More...

#include <kaycxx/http/response_error.hpp>

Inheritance diagram for kaycxx::http::response_error:
Collaboration diagram for kaycxx::http::response_error:

Public Member Functions

 response_error (std::string message, buffered_response response)
 Creates an HTTP response error.
 ~response_error () override
 Destroys the HTTP response error.
const buffered_responseresponse () const &noexcept
 Returns the HTTP response which caused this error.
buffered_response response () &&noexcept
 Moves the HTTP response out of an expiring response error.
Public Member Functions inherited from kaycxx::http::error
 error (std::string message)
 Creates an HTTP client error.
 ~error () override
 Destroys the HTTP client error.

Detailed Description

Exception thrown when a server responds with a non-success status code.

Constructor & Destructor Documentation

◆ response_error()

kaycxx::http::response_error::response_error ( std::string message,
buffered_response response )

Creates an HTTP response error.

Parameters
messageError message.
responseHTTP response returned by the server.

Member Function Documentation

◆ response() [1/2]

buffered_response kaycxx::http::response_error::response ( ) &&
nodiscardnoexcept

Moves the HTTP response out of an expiring response error.

Returns
HTTP response returned by the server.

◆ response() [2/2]

const buffered_response & kaycxx::http::response_error::response ( ) const &
nodiscardnoexcept

Returns the HTTP response which caused this error.

The returned reference remains valid until this exception is destroyed, moved from or assigned a new value.

Returns
HTTP response returned by the server.

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