16 #ifndef FILENOTFOUNDEXCEPTION_HPP
17 #define FILENOTFOUNDEXCEPTION_HPP
19 #include "Athena/Exception.hpp"
40 Exception(std::string(
"FileNotFoundException: Could not find file \"") + filename + std::string(
"\", please check that it exists."), file, function, line),
43 m_exceptionName =
"FileNotFoundException";
49 inline std::string
filename()
const {
return m_filename; }
51 std::string m_filename;
56 #ifndef THROW_FILE_NOT_FOUND_EXCEPTION
57 #define THROW_FILE_NOT_FOUND_EXCEPTION(msg) \
59 if (atGetExceptionHandler()) \
61 atGetExceptionHandler()(__FILE__, AT_PRETTY_FUNCTION, __LINE__, msg); \
65 throw Athena::error::FileNotFoundException(msg, __FILE__, AT_PRETTY_FUNCTION, __LINE__); \
69 #ifndef THROW_FILE_NOT_FOUND_EXCEPTION_RETURN
70 #define THROW_FILE_NOT_FOUND_EXCEPTION_RETURN(ret, msg) \
72 if (atGetExceptionHandler()) \
74 atGetExceptionHandler()(__FILE__, AT_PRETTY_FUNCTION, __LINE__, msg); \
78 throw Athena::error::FileNotFoundException(msg, __FILE__, AT_PRETTY_FUNCTION, __LINE__); \
83 #endif // FILENOTFOUNDEXCEPTION_HPP
FileNotFoundException(const std::string &filename, const std::string &file, const std::string &function, const int line)
The constructor for an FileNotFoundException.
std::string filename() const
Returns the path of the offending file.
An excpeption thrown when a file could not be found at the given path.
The baseclass for all Exceptions.