From f404efd0c7e58d2e68081bda38b27ae3b718842a Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Wed, 11 Apr 2018 22:23:57 +0100 Subject: Adding exceptions --- yage/core/exception.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 yage/core/exception.cpp (limited to 'yage/core/exception.cpp') diff --git a/yage/core/exception.cpp b/yage/core/exception.cpp new file mode 100644 index 00000000..5cf525cc --- /dev/null +++ b/yage/core/exception.cpp @@ -0,0 +1,20 @@ +#include "exception.h" + +namespace yage +{ + +FileLoadException::FileLoadException(std::string err) : std::runtime_error("File Load Exception") +{ + std::ostringstream msg(""); + + msg << runtime_error::what() << ": " << err; + + err_msg = msg.str(); +} + +const char *FileLoadException::what() const throw() +{ + return err_msg.c_str(); +} + +} // namespace yage -- cgit