SDK Exceptions

#include <dolbyio/comms/exception.h>

Exception’s which can be thrown by the SDK and caught by user. These have been left defined

class dolbyio::comms::exception : public exception

The base class for the SDK exceptions.

Subclassed by dolbyio::comms::async_operation_canceled, dolbyio::comms::certificate_exception, dolbyio::comms::conference_exception, dolbyio::comms::io_exception, dolbyio::comms::json_exception, dolbyio::comms::jwt_exception, dolbyio::comms::media_exception, dolbyio::comms::session_exception, dolbyio::comms::spatial_placement_exception

Public Functions

inline exception(const std::string &description)

The constructor that takes the description of the exception.

Parameters:

description – A string indicating a reason for the exception.

inline const char *what() const noexcept override

Overrides to std::exception that returns a description of the exception.

Returns:

A string that describes the exception.

class dolbyio::comms::async_operation_canceled : public dolbyio::comms::exception

The base class that describes exceptions that are thrown when an asynchronous operation is abruptly canceled.

Public Functions

async_operation_canceled(const std::string &reason)

The constructor that takes a reason for failure.

Parameters:

reason – A string that indicates a reason for failure.

class dolbyio::comms::json_exception : public dolbyio::comms::exception

The base class for the JSON and depicts exceptions that are thrown when there is a JSON parsing error. This means an error in serializing or deserializing JSON string or object.

Public Functions

json_exception(std::string &&description, std::string &&path)

The constructor that takes a description of the exception.

Parameters:
  • description – The description of the exception.

  • path – JSON object path

inline const std::string &path() const noexcept

The accessor that returns the full path of the exception.

Returns:

A string that contains a full path of the exception.

inline const std::string &desc() const noexcept

The accessor that returns a description of the exception string.

Returns:

A string that contains a description of the exception.

class dolbyio::comms::jwt_exception : public dolbyio::comms::exception

Describes the JSON web token exceptions indicating that the authentication web token is not correct.

Public Functions

jwt_exception(const std::string &jwt_body)

The constructor that takes the body of the token.

Parameters:

jwt_body – The body of the web token.

class dolbyio::comms::io_exception : public dolbyio::comms::exception

The base class for all IO exceptions that occur in the case of problems with opening sockets or files.

Subclassed by dolbyio::comms::http_exception, dolbyio::comms::restapi_exception, dolbyio::comms::security_check_exception, dolbyio::comms::signaling_channel_exception

Public Functions

io_exception(const std::string &description)

The constructor that takes the description of the exception.

Parameters:

description – A string that describes the exception.

class dolbyio::comms::http_exception : public dolbyio::comms::io_exception

The class that describes the HTTP errors.

Public Functions

http_exception(int code)

The constructor that takes the HTTP error code.

Parameters:

code – The HTTP error code.

inline int http_code() const noexcept

The accessor that returns the HTTP error code of the exception.

Returns:

An integer value that represents the HTTP error code.

class dolbyio::comms::restapi_exception : public dolbyio::comms::io_exception

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

Subclassed by dolbyio::comms::invalid_token_exception

Public Functions

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.

inline int http_code() const noexcept

The accessor for the HTTP code of the exception.

Returns:

An integer that represents the HTTP code.

inline int rest_code() const noexcept

The accessor for the REST code of the exception.

Returns:

An integer that represents the REST error code.

inline const std::string &reason() const noexcept

The accessor for the reason of the error.

Returns:

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

inline const std::string &description() const noexcept

The accessor for the error description.

Returns:

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

class dolbyio::comms::session_exception : public dolbyio::comms::exception

The class that describes errors related to the Session Service.

Subclassed by dolbyio::comms::services::session::state_exception

Public Functions

session_exception(const std::string &description)

The constructor that takes the error description.

Parameters:

description – A string that describes the exception.

class dolbyio::comms::services::session::state_exception : public dolbyio::comms::session_exception

The class that defines exceptions for invalid session states.

Public Functions

state_exception(state current, state required)

The constructor that takes the current and the required state of a session.

Parameters:
  • current – The current state of the session.

  • required – The required state of the session.

inline state current_state() const noexcept

Returns the current state of a session that is stored in the exception.

Returns:

The current state of the session.

inline state required_state() const noexcept

Returns the required state of a session that is stored in the exception.

Returns:

A string that contains the required state of a session.

class dolbyio::comms::conference_exception : public dolbyio::comms::exception

The class that describes errors that occur in an active conference.

Subclassed by dolbyio::comms::conference_state_exception, dolbyio::comms::media_engine_exception

Public Functions

conference_exception(const std::string &description)

The constructor that takes the exception description.

Parameters:

description – The description of the exception.

class dolbyio::comms::conference_state_exception : public dolbyio::comms::conference_exception

The class that describes errors for attempted operations that require a different conference state.

Public Functions

conference_state_exception(const std::string &current, const std::string &required)

The constructor that takes the current the required state.

Parameters:
  • current – The current state of a conference.

  • required – The required state of a conference.

inline const std::string &current_state() const noexcept

Returns the current state of a conference that is stored in the exception.

Returns:

The current session state.

inline const std::string &required_state() const noexcept

Returns the required state of a conference that is stored in the exception.

Returns:

A string that contains the required state of a conference.

class dolbyio::comms::media_exception : public dolbyio::comms::exception

The base exception class for exceptions originating from the media_engine.

Subclassed by dolbyio::comms::dvc_exception

Public Functions

inline media_exception(std::string &&description)

The constructor that takes a description of the exception.

Parameters:

description – The description of the exception.

class dolbyio::comms::dvc_exception : public dolbyio::comms::media_exception

Describes exceptions originating from the DVC library.

Public Functions

inline dvc_exception(std::string &&description)

The constructor that takes a description of the exception.

Parameters:

description – The description of the exception.

class dolbyio::comms::certificate_exception : public dolbyio::comms::exception

Describes the exception thrown if WebRTC fails to generate a certificate.

Public Functions

inline certificate_exception(std::string &&description)

The constructor that takes a description of the exception.

Parameters:

description – The description of the exception.