#include <iris_base/export.h>
#include <exception>
#include <string>
#include <typeinfo>
Go to the source code of this file.
|
#define | DEFINE_IRIS_SDK_EXCEPTION(x, ERROR_CODE) |
|
#define | RETHROW_ROOT(x) try{ x; } catch (iris_sdk::base_exception &e) { rethrow_root_exception(e); } |
|
#define | RETHROW_IF_NESTED(x) try{ x; } catch (iris_sdk::base_exception &e) { std::rethrow_if_nested(e); } |
|
|
| iris_sdk::DEFINE_IRIS_SDK_EXCEPTION (runtime_error, 1) |
|
| iris_sdk::DEFINE_IRIS_SDK_EXCEPTION (file_not_found_error, 2) |
|
| iris_sdk::DEFINE_IRIS_SDK_EXCEPTION (file_error, 3) |
|
| iris_sdk::DEFINE_IRIS_SDK_EXCEPTION (invalid_parameter_error, 4) |
|
| iris_sdk::DEFINE_IRIS_SDK_EXCEPTION (key_exists_error, 5) |
|
| iris_sdk::DEFINE_IRIS_SDK_EXCEPTION (limit_exceed_error, 6) |
|
| iris_sdk::DEFINE_IRIS_SDK_EXCEPTION (license_error, 7) |
|
| iris_sdk::DEFINE_IRIS_SDK_EXCEPTION (data_container_corrupted_error, 8) |
|
| iris_sdk::DEFINE_IRIS_SDK_EXCEPTION (key_not_found_error, 9) |
|
| iris_sdk::DEFINE_IRIS_SDK_EXCEPTION (invalid_signature_error, 10) |
|
void IRIS_SDK_EXPORT | iris_sdk::rethrow_root_exception (base_exception &exc) |
| Use function for throwing the bottom of nested exceptions stack. More...
|
|
std::string IRIS_SDK_EXPORT | iris_sdk::format_exception (const base_exception &exc, int level=0) |
| Use function for building info message with the chain of nested exceptions stack. More...
|
|
bool IRIS_SDK_EXPORT | iris_sdk::is_root_exception_of_type (const std::type_info &tp, const base_exception &e) |
|
◆ DEFINE_IRIS_SDK_EXCEPTION
#define DEFINE_IRIS_SDK_EXCEPTION |
( |
|
x, |
|
|
|
ERROR_CODE |
|
) |
| |
Value:\
class IRIS_SDK_EXPORT x : public base_exception \
{ \
public: \
x() : base_exception() \
{ _type_name = std::string(#x); } \
\
explicit x(const std::string &message) \
: base_exception(message, ERROR_CODE) \
{ _type_name = std::string(#x); } \
}
◆ format_exception()
std::string IRIS_SDK_EXPORT iris_sdk::format_exception |
( |
const base_exception & |
exc, |
|
|
int |
level = 0 |
|
) |
| |
Use function for building info message with the chain of nested exceptions stack.
- Parameters
-
[in] | exc | Exception |
[in] | level | Format level |
- Returns
- formatted string
◆ rethrow_root_exception()
void IRIS_SDK_EXPORT iris_sdk::rethrow_root_exception |
( |
base_exception & |
exc | ) |
|
Use function for throwing the bottom of nested exceptions stack.
- Parameters
-
- Exceptions
-
- Returns
- Nothing