16class Error :
public std::exception {
27 explicit Error(
ob_error *error) : impl_(error) {};
29 Error &operator=(
const Error &) =
default;
39 if(!error || !*error) {
67 const char *
what() const noexcept
override {
68 return impl_->message;
78 return impl_->exception_type;
87 return impl_->function;
106 return impl_->message;
115 return impl_->status;
121 return impl_->function;
Functions for handling errors, mainly used for obtaining error messages.
OB_EXPORT void ob_delete_error(ob_error *error)
Delete the error object.
OBExceptionType
The exception types in the SDK, through the exception type, you can easily determine the specific typ...
const char * getName() const noexcept
const char * what() const noexcept override
Returns the error message of the exception.
const char * getMessage() const noexcept
Returns the error message of the exception.
~Error() override
Destroy the Error object.
const char * getFunction() const noexcept
Returns the name of the function where the exception occurred.
const char * getArgs() const noexcept
Returns the arguments of the function where the exception occurred.
OBStatus getStatus() const noexcept
Returns the error status code of the exception.
OBExceptionType getExceptionType() const noexcept
Returns the exception type of the exception.
static void handle(ob_error **error, bool throw_exception=true)
A static function to handle the ob_error and throw an exception if needed.
The error class exposed by the SDK, users can get detailed error information according to the error.