23 Error(
int val, const
std::error_category& cat) noexcept;
25 const
std::error_category& cat,
26 const
std::
string& error_reason);
27 Error(const
std::exception_ptr& exception) noexcept;
32 std::enable_if_t<
std::is_error_condition_enum<EnumT>::value,
void>>
33 Error(EnumT value) :
Error(make_error_condition(value)) {}
38 std::enable_if_t<std::is_error_condition_enum<EnumT>::value,
void>>
39 Error(EnumT value,
const std::string& reason)
45 std::enable_if_t<std::is_error_condition_enum<EnumT>::value,
void>>
54 [[nodiscard]]
const std::string&
message()
const {
return _message; }
57 std::string _message{};
91 [[nodiscard]]
const char*
name() const noexcept override;
92 [[nodiscard]]
std::
string message(
int ev) const override;
101 EXCEPTION_THROWN = 1,
113 PEERCONNECTION_LOCAL_DESC,
115 PEERCONNECTION_REMOTE_DESC,
119 PEERCONNECTION_SET_TRANSFORM_FAILED,
122 INVALID_MEDIA_PERMISSIONS
125 [[nodiscard]]
const char*
name() const noexcept override;
126 [[nodiscard]]
std::
string message(
int ev) const override;
133 REQUEST_ABORTED = -1,
134 REQUEST_ABORTED_APPLE = 0,
135 JNI_INVALID_ARGUMENT = -101,
136 JNI_OUT_OF_RANGE = -102,
137 EMPTY_RESPONSE = -103,
141 [[nodiscard]]
const char*
name() const noexcept override;
142 [[nodiscard]]
std::
string message(
int ev) const override;
174template <
typename EnumT>
175std::enable_if_t<std::is_error_condition_enum<EnumT>::value,
Error>
187 const std::string& message);
196 const std::string& message);
205 const std::string& message);
211struct is_error_condition_enum<
millicast::AsyncOperationCancelled::Value>
212 :
public std::true_type {};
214struct is_error_condition_enum<
millicast::GenericError::Value>
215 :
public std::true_type {};
Error category for errors triggered when the operation failed because it was abandoned for various re...
Definition error.h:79
Value
Definition error.h:81
@ TIMEOUT
Operation was cancelled due to a timeout.
Definition error.h:88
@ ABANDONED
Operation was cancelled for unspecified reasons.
Definition error.h:85
const char * name() const noexcept override
The errors reported by the Millicast SDK.
Definition error.h:16
const std::string & message() const
Get the error message.
Definition error.h:54
Error(Error &&) noexcept=default
Error(EnumT value, const std::string &reason)
Definition error.h:39
bool operator==(EnumT val) const
Definition error.h:46
const Error & get_error() const
Get the Error object passed with this exception.
Exception(const Error &err)
Error category for other errors.
Definition error.h:98
const char * name() const noexcept override
Value
Definition error.h:100
@ PEERCONNECTION_CREATE_OFFER
Can not create PeerConnection offer.
Definition error.h:112
@ INVALID_JSON
Signaling provided invalid JSON.
Definition error.h:102
@ PEERCONNECTION_NOT_ESTABLISHED
PeerConnection was not established.
Definition error.h:118
@ NO_CREDENTIALS
No credentials are set.
Definition error.h:106
@ WEBSOCKET_HS_FAILED
Websocket not connected.
Definition error.h:110
@ INVALID_OPTIONS
Invalid options set for the request.
Definition error.h:107
@ NULL_LISTENER
Listener not set while it should be.
Definition error.h:121
@ PEERCONNECTION_ADD_TRACKS_FAILED
Can not add tracks.
Definition error.h:117
@ REST_API_ERROR
Director REST API returned an error.
Definition error.h:109
@ INVALID_STATE
Invalid state of the client.
Definition error.h:108
@ TRANSACTION_ERROR
Signaling returned error for the request.
Definition error.h:105
@ PEERCONNECTION_CREATE
Can not create PeerConnection.
Definition error.h:111
const char * name() const noexcept override
Value
Definition error.h:131
#define MILLICAST_TEMPLATE_API
Definition exports.h:46
#define MILLICAST_API
Definition exports.h:51
Definition capabilities.h:15
std::enable_if_t< std::is_error_condition_enum< EnumT >::value, Error > make_error_condition(EnumT value)
Helper to create Error object from the enum value defined in Millicast error category.
Definition error.h:176
Helper for defining error categories in the Millicast SDK.
Definition error.h:67
static const T & instance()
Definition error.h:68