16 #ifndef INVALIDDATAEXCEPTION_HPP
17 #define INVALIDDATAEXCEPTION_HPP
19 #include "Athena/Exception.hpp"
38 inline InvalidDataException(
const std::string& error,
const std::string& file,
const std::string&
function,
const int line)
39 :
Exception((
"InvalidDataException") + error, file,
function, line)
41 m_exceptionName =
"InvalidDataException";
48 #define THROW_INVALID_DATA_EXCEPTION(args, ...) \
50 if (atGetExceptionHandler()) {atGetExceptionHandler()(__FILE__, AT_PRETTY_FUNCTION, __LINE__, __VA_ARGS__); return; } \
51 else { std::string msg = Athena::utility::sprintf(args, __VA_ARGS__); \
52 throw Athena::error::InvalidDataException(msg, __FILE__, AT_PRETTY_FUNCTION, __LINE__); \
55 #elif defined(__GNUC__)
56 #define THROW_INVALID_DATA_EXCEPTION(args...) \
57 do { if (atGetExceptionHandler()) {atGetExceptionHandler()(__FILE__, AT_PRETTY_FUNCTION, __LINE__, args); return; } \
58 else { std::string msg = Athena::utility::sprintf(args); \
59 throw Athena::error::InvalidDataException(msg, __FILE__, AT_PRETTY_FUNCTION, __LINE__); \
65 #define THROW_INVALID_DATA_EXCEPTION(args, ...) \
67 if (atGetExceptionHandler()) {atGetExceptionHandler()(__FILE__, AT_PRETTY_FUNCTION, __LINE__, __VA_ARGS__); return; } \
68 else { std::string msg = Athena::utility::sprintf(args, __VA_ARGS__); \
69 throw Athena::error::InvalidDataException(msg, __FILE__, AT_PRETTY_FUNCTION, __LINE__); \
72 #elif defined(__GNUC__)
73 #define THROW_INVALID_DATA_EXCEPTION_RETURN(ret, args...) \
74 do { if (atGetExceptionHandler()) {atGetExceptionHandler()(__FILE__, AT_PRETTY_FUNCTION, __LINE__, args); return ret; } \
75 else { std::string msg = Athena::utility::sprintf(args); \
76 throw Athena::error::InvalidDataException(msg, __FILE__, AT_PRETTY_FUNCTION, __LINE__); \
80 #endif // INVALIDDATAEXCEPTION_HPP
Exception(const std::string &message, const std::string &file, const std::string &function, const int line)
The constructor for an Exception.
An exception thrown on Invalid Data calls.
The baseclass for all Exceptions.