restapi_exception

Module: Exceptions

The class that describes errors received from the backend service during REST API calls.

#include <exception.h>

Inherits from dolbyio::comms::io_exception, dolbyio::comms::exception, exception

Inherited by dolbyio::comms::invalid_token_exception

Public Functions

Name
restapi_exception(int http_code, int rest_code, const std::string & err_reason, const std::string & err_description)
The constructor that takes the error code, reason, and description of the error from a server response.
intrest_code() const
The accessor for the REST code of the exception.
const std::string &reason() const
The accessor for the reason of the error.
inthttp_code() const
The accessor for the HTTP code of the exception.
const std::string &description() const
The accessor for the error description.

Additional inherited members

Public Functions inherited from dolbyio::comms::io_exception

Name
io_exception(const std::string & description)
The constructor that takes the description of the exception.

Public Functions inherited from dolbyio::comms::exception

Name
~exception() =default
const char *what() const override
Overrides to std::exception that returns a description of the exception.
exception(const std::string & description)
The constructor that takes the description of the exception.

Protected Attributes inherited from dolbyio::comms::exception

Name
std::stringfulldescription
class dolbyio::comms::restapi_exception;

Public Functions Documentation

function restapi_exception

inline restapi_exception(
    int http_code,
    int rest_code,
    const std::string & err_reason,
    const std::string & err_description
)

The constructor that takes the error code, reason, and description of the error from a server response.

Parameters:

  • http_code The HTTP code.
  • rest_code The REST API code.
  • err_reason The reason for the error.
  • err_description The error description.

function rest_code

inline int rest_code() const

The accessor for the REST code of the exception.

Return: An integer that represents the REST error code.

function reason

inline const std::string & reason() const

The accessor for the reason of the error.

Return: A string that contains the reason for the error returned in the REST response.

function http_code

inline int http_code() const

The accessor for the HTTP code of the exception.

Return: An integer that represents the HTTP code.

function description

inline const std::string & description() const

The accessor for the error description.

Return: A string that contains the description of the error returned in the REST response.



Did this page help you?