#include <boost/format.hpp>
#include <stdexcept>
#include <string>
#include <vector>
#include "errors.h"
Go to the source code of this file.
Classes | |
class | Common::Error |
struct | Common::ErrorData |
Namespaces | |
namespace | Common |
Addon interface definition GNU LGPL. | |
Defines | |
#define | BEGIN_TRY_BLOCK try{ |
#define | CREATE_COMMON_ERROR(code, message) Common::CreateError(__LINE__, __FILE__, code, message) |
#define | CREATE_ERROR(data) ::Common::CreateError(__LINE__, __FILE__, data.ErrorCode, data.ErrorMessage) |
#define | CREATE_ERROR1(data, param1) (::Common::CreateError(__LINE__, __FILE__, data.ErrorCode, data.ErrorMessage, param1)) |
Last parameter can be any type (is a format message parameter) or sub error. | |
#define | CREATE_ERROR2(data, param1, param2) ::Common::CreateError(__LINE__, __FILE__, data.ErrorCode, data.ErrorMessage, param1, param2) |
#define | CREATE_ERROR3(data, param1, param2, param3) ::Common::CreateError(__LINE__, __FILE__, data.ErrorCode, data.ErrorMessage, param1, param2, param3) |
#define | CREATE_ERROR4(data, param1, param2, param3, param4) ::Common::CreateError(__LINE__, __FILE__, data.ErrorCode, data.ErrorMessage, param1, param2, param3, param4) |
#define | END_TRY_BLOCK(handler) |
#define | ERROR_CODE(module_id, code) (module_id << 16 | (code & 8)) |
#define | THROW_COMMON_ERROR(code, message) throw ::Common::CreateError(__LINE__, __FILE__, code, message) |
#define | THROW_ERROR(data) throw ::Common::CreateError(__LINE__, __FILE__, data.ErrorCode, data.ErrorMessage) |
#define | THROW_ERROR1(data, param1) throw CREATE_ERROR1(data, param1); |
#define | THROW_ERROR2(data, param1, param2) throw CREATE_ERROR2(data, param1, param2) |
#define | THROW_ERROR3(data, param1, param2, param3) throw CREATE_ERROR3(data, param1, param2, param3) |
#define | THROW_ERROR4(data, param1, param2, param3, param4) throw CREATE_ERROR4(data, param1, param2, param3, param4) |
#define | THROW_OS_ERROR(UserMsg) (throw ::Common::CreateError(__LINE__, __FILE__, errno, "%1% %2%.", UserMsg, strerror(errno))) |
Functions | |
Error | Common::CreateError (unsigned lineNum, const char *filename, unsigned errorCode, const char *msg) |
template<typename T1 > | |
Error | Common::CreateError (unsigned lineNum, const char *fileName, unsigned errorCode, const char *msg, const T1 ¶m1) |
template<typename T1 > | |
Error | Common::CreateError (unsigned lineNum, const char *fileName, unsigned errorCode, const char *msg, const T1 ¶m1, const Common::Error &subError) |
template<typename T1 , typename T2 > | |
Error | Common::CreateError (unsigned lineNum, const char *fileName, unsigned errorCode, const char *msg, const T1 ¶m1, const T2 ¶m2) |
template<typename T1 , typename T2 > | |
Error | Common::CreateError (unsigned lineNum, const char *fileName, unsigned errorCode, const char *msg, const T1 ¶m1, const T2 ¶m2, const Common::Error &subError) |
template<typename T1 , typename T2 , typename T3 > | |
Error | Common::CreateError (unsigned lineNum, const char *fileName, unsigned errorCode, const char *msg, const T1 ¶m1, const T2 ¶m2, const T3 ¶m3) |
template<typename T1 , typename T2 , typename T3 > | |
Error | Common::CreateError (unsigned lineNum, const char *fileName, unsigned errorCode, const char *msg, const T1 ¶m1, const T2 ¶m2, const T3 ¶m3, const Common::Error &subError) |
template<typename T1 , typename T2 , typename T3 , typename T4 > | |
Error | Common::CreateError (unsigned lineNum, const char *fileName, unsigned errorCode, const char *msg, const T1 ¶m1, const T2 ¶m2, const T3 ¶m3, const T4 ¶m4) |
template<typename T1 , typename T2 , typename T3 , typename T4 > | |
Error | Common::CreateError (unsigned lineNum, const char *fileName, unsigned errorCode, const char *msg, const T1 ¶m1, const T2 ¶m2, const T3 ¶m3, const T4 ¶m4, const Common::Error &subError) |
#define BEGIN_TRY_BLOCK try{ |
Definition at line 228 of file exception.h.
#define CREATE_COMMON_ERROR | ( | code, | |
message | |||
) | Common::CreateError(__LINE__, __FILE__, code, message) |
Definition at line 206 of file exception.h.
#define CREATE_ERROR | ( | data | ) | ::Common::CreateError(__LINE__, __FILE__, data.ErrorCode, data.ErrorMessage) |
Definition at line 208 of file exception.h.
#define CREATE_ERROR1 | ( | data, | |
param1 | |||
) | (::Common::CreateError(__LINE__, __FILE__, data.ErrorCode, data.ErrorMessage, param1)) |
Last parameter can be any type (is a format message parameter) or sub error.
Definition at line 211 of file exception.h.
#define CREATE_ERROR2 | ( | data, | |
param1, | |||
param2 | |||
) | ::Common::CreateError(__LINE__, __FILE__, data.ErrorCode, data.ErrorMessage, param1, param2) |
Definition at line 214 of file exception.h.
#define CREATE_ERROR3 | ( | data, | |
param1, | |||
param2, | |||
param3 | |||
) | ::Common::CreateError(__LINE__, __FILE__, data.ErrorCode, data.ErrorMessage, param1, param2, param3) |
Definition at line 217 of file exception.h.
#define CREATE_ERROR4 | ( | data, | |
param1, | |||
param2, | |||
param3, | |||
param4 | |||
) | ::Common::CreateError(__LINE__, __FILE__, data.ErrorCode, data.ErrorMessage, param1, param2, param3, param4) |
Definition at line 220 of file exception.h.
#define END_TRY_BLOCK | ( | handler | ) |
}\ catch (const ::Common::Error& err)\ {\ return handler(err);\ }\ catch (const std::exception& exc)\ {\ return handler(CREATE_ERROR1(StdException, exc.what()));\ }
Definition at line 229 of file exception.h.
#define ERROR_CODE | ( | module_id, | |
code | |||
) | (module_id << 16 | (code & 8)) |
Definition at line 203 of file exception.h.
#define THROW_COMMON_ERROR | ( | code, | |
message | |||
) | throw ::Common::CreateError(__LINE__, __FILE__, code, message) |
Definition at line 205 of file exception.h.
#define THROW_ERROR | ( | data | ) | throw ::Common::CreateError(__LINE__, __FILE__, data.ErrorCode, data.ErrorMessage) |
Definition at line 207 of file exception.h.
#define THROW_ERROR1 | ( | data, | |
param1 | |||
) | throw CREATE_ERROR1(data, param1); |
Definition at line 212 of file exception.h.
#define THROW_ERROR2 | ( | data, | |
param1, | |||
param2 | |||
) | throw CREATE_ERROR2(data, param1, param2) |
Definition at line 215 of file exception.h.
#define THROW_ERROR3 | ( | data, | |
param1, | |||
param2, | |||
param3 | |||
) | throw CREATE_ERROR3(data, param1, param2, param3) |
Definition at line 218 of file exception.h.
#define THROW_ERROR4 | ( | data, | |
param1, | |||
param2, | |||
param3, | |||
param4 | |||
) | throw CREATE_ERROR4(data, param1, param2, param3, param4) |
Definition at line 221 of file exception.h.
#define THROW_OS_ERROR | ( | UserMsg | ) | (throw ::Common::CreateError(__LINE__, __FILE__, errno, "%1% %2%.", UserMsg, strerror(errno))) |
Definition at line 226 of file exception.h.