29 std::string type_name()
const;
31 const char* what()
const noexcept
override;
33 uint64_t code()
const noexcept;
38 std::string _type_name;
41 #define DEFINE_IRIS_SDK_EXCEPTION(x, ERROR_CODE) \ 43 class IRIS_SDK_EXPORT x : public base_exception \ 46 x() : base_exception() \ 47 { _type_name = std::string(#x); } \ 49 explicit x(const std::string &message) \ 50 : base_exception(message, ERROR_CODE) \ 51 { _type_name = std::string(#x); } \ 54 DEFINE_IRIS_SDK_EXCEPTION(runtime_error, 1);
56 DEFINE_IRIS_SDK_EXCEPTION(file_not_found_error, 2);
58 DEFINE_IRIS_SDK_EXCEPTION(file_error, 3);
60 DEFINE_IRIS_SDK_EXCEPTION(invalid_parameter_error, 4);
62 DEFINE_IRIS_SDK_EXCEPTION(key_exists_error, 5);
64 DEFINE_IRIS_SDK_EXCEPTION(limit_exceed_error, 6);
66 DEFINE_IRIS_SDK_EXCEPTION(license_error, 7);
68 DEFINE_IRIS_SDK_EXCEPTION(data_container_corrupted_error, 8);
70 DEFINE_IRIS_SDK_EXCEPTION(key_not_found_error, 9);
72 DEFINE_IRIS_SDK_EXCEPTION(invalid_signature_error, 10);
90 bool IRIS_SDK_EXPORT is_root_exception_of_type(
const std::type_info &tp,
const base_exception &e);
92 #define RETHROW_ROOT(x) try{ x; } catch (iris_sdk::base_exception &e) { rethrow_root_exception(e); } 94 #define RETHROW_IF_NESTED(x) try{ x; } catch (iris_sdk::base_exception &e) { std::rethrow_if_nested(e); }
The iris sdk base exception.
Definition: exception.h:19
void IRIS_SDK_EXPORT rethrow_root_exception(base_exception &exc)
Use function for throwing the bottom of nested exceptions stack.
std::string IRIS_SDK_EXPORT format_exception(const base_exception &exc, int level=0)
Use function for building info message with the chain of nested exceptions stack. ...