10Duke Scale C++ Client
Loading...
Searching...
No Matches
tenduke::http::HTTPResponseToException Class Reference

#include <HTTPResponseToException.h>

Detailed Description

Utility service to throw an exception based on tenduke::http::HTTPResponse.

This service generates default exceptions for HTTP status codes and can be specialized if needed. Subclasses can look inside the HTTP response for further diagnosis, this class does not access the response body.

Not all HTTP-status codes implemented yet.

Inheritance diagram for tenduke::http::HTTPResponseToException:
tenduke::oauth::HTTPResponseToOAuthException tenduke::se::http::HTTPResponseToAPIException

Public Member Functions

virtual void basedOn (tenduke::http::HTTPResponse &response) const
 Throws exception based on given HTTP response.
 

Protected Member Functions

virtual void from4xx (tenduke::http::HTTPResponse &response) const
 Throws exception for HTTP 4xx responses.
 
virtual void from4xx (int httpStatusCode) const
 Throws exception, when HTTP-status code is 4xx.
 
virtual void from400 () const
 Throws exception, when HTTP-status code is 400.
 
virtual void from401 () const
 Throws exception, when HTTP-status code is 401.
 
virtual void from403 () const
 Throws exception, when HTTP-status code is 403.
 
virtual void from404 () const
 Throws exception, when HTTP-status code is 404.
 
virtual void from4xxOther (int httpStatusCode) const
 Throws exception, when HTTP-status code some other 4xx-series.
 
virtual void from5xx (tenduke::http::HTTPResponse &response) const
 Throws exception for 5xx responses.
 
virtual void from5xx (int httpStatusCode) const
 Throws exception, when status code is any 5xx-series.
 

Member Function Documentation

◆ basedOn()

void tenduke::http::HTTPResponseToException::basedOn ( tenduke::http::HTTPResponse response) const
virtual

Throws exception based on given HTTP response.

Parameters
response-

◆ from4xx() [1/2]

void tenduke::http::HTTPResponseToException::from4xx ( int  httpStatusCode) const
protectedvirtual

Throws exception, when HTTP-status code is 4xx.

Parameters
httpStatusCode-

◆ from4xx() [2/2]

void tenduke::http::HTTPResponseToException::from4xx ( tenduke::http::HTTPResponse response) const
protectedvirtual

Throws exception for HTTP 4xx responses.

Parameters
response-

Reimplemented in tenduke::oauth::HTTPResponseToOAuthException, and tenduke::se::http::HTTPResponseToAPIException.

◆ from4xxOther()

void tenduke::http::HTTPResponseToException::from4xxOther ( int  httpStatusCode) const
protectedvirtual

Throws exception, when HTTP-status code some other 4xx-series.

Parameters
httpStatusCode-

◆ from5xx() [1/2]

void tenduke::http::HTTPResponseToException::from5xx ( int  httpStatusCode) const
protectedvirtual

Throws exception, when status code is any 5xx-series.

Parameters
httpStatusCode-

◆ from5xx() [2/2]

void tenduke::http::HTTPResponseToException::from5xx ( tenduke::http::HTTPResponse response) const
protectedvirtual

Throws exception for 5xx responses.

Parameters
response-

Reimplemented in tenduke::se::http::HTTPResponseToAPIException.


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