Iris SDK  1.0
Iris Recognition Software Development Kit
Classes | Macros | Functions
exception.h File Reference
#include <iris_base/export.h>
#include <exception>
#include <string>
#include <typeinfo>
Include dependency graph for exception.h:

Go to the source code of this file.

Classes

class  iris_sdk::base_exception
 The iris sdk base exception. More...
 

Macros

#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); }
 

Functions

 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)
 

Macro Definition Documentation

◆ 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); } \
}

Function Documentation

◆ 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]excException
[in]levelFormat 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
[in]excException
Exceptions
iris_sdk::exceptionSee Exceptions handling.
Returns
Nothing