16 #ifndef INVALID_OPERATION_EXCEPTION_HPP
17 #define INVALID_OPERATION_EXCEPTION_HPP
21 #include "Athena/Exception.hpp"
45 m_exceptionName =
"InvalidOperationException";
52 #define THROW_INVALID_OPERATION_EXCEPTION(args, ...) \
54 if (atGetExceptionHandler()) {atGetExceptionHandler()(__FILE__, AT_PRETTY_FUNCTION, __LINE__, __VA_ARGS__); return; \
56 std::string msg = Athena::utility::sprintf(args, __VA_ARGS__);
63 #elif defined (__GNUC__)
64 #define THROW_INVALID_OPERATION_EXCEPTION(args...) \
66 if (atGetExceptionHandler()) {atGetExceptionHandler()(__FILE__, AT_PRETTY_FUNCTION, __LINE__, args); return; \
67 } else { std::string msg = Athena::utility::sprintf(args); \
68 throw Athena::error::InvalidOperationException(msg, __FILE__, AT_PRETTY_FUNCTION, __LINE__); \
74 #define THROW_INVALID_OPERATION_EXCEPTIONRETURN(ret, args, ...) \
76 if (atGetExceptionHandler()) {atGetExceptionHandler()(__FILE__, AT_PRETTY_FUNCTION, __LINE__, __VA_ARGS__); return ret; \
78 std::string msg = Athena::utility::sprintf(args, __VA_ARGS__);
86 #elif defined(__GNUC__)
87 #define THROW_INVALID_OPERATION_EXCEPTION_RETURN(ret, args...) \
89 if (atGetExceptionHandler()) {atGetExceptionHandler()(__FILE__, AT_PRETTY_FUNCTION, __LINE__, args); return ret; \
90 } else { std::string msg = Athena::utility::sprintf(args); \
91 throw Athena::error::InvalidOperationException(msg, __FILE__, AT_PRETTY_FUNCTION, __LINE__); \
95 #endif // INVALID_OPERATION_EXCEPTION_HPP
InvalidOperationException(const std::string &message, const std::string &file, const std::string &function, const int line)
The constructor for an InvalidOperationException.
std::string message() const
Returns the Error message of the exception.
An excpeption thrown on Invalid Operations calls.
The baseclass for all Exceptions.