aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Common/je_exception.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/Common/je_exception.h')
-rw-r--r--src/libjin/Common/je_exception.h35
1 files changed, 29 insertions, 6 deletions
diff --git a/src/libjin/Common/je_exception.h b/src/libjin/Common/je_exception.h
index 7c66af8..c319ebd 100644
--- a/src/libjin/Common/je_exception.h
+++ b/src/libjin/Common/je_exception.h
@@ -1,19 +1,42 @@
-#ifndef __JE_EXCEPTION_H
-#define __JE_EXCEPTION_H
+#ifndef __JE_EXCEPTION_H__
+#define __JE_EXCEPTION_H__
#include <exception>
+#include <string>
namespace JinEngine
{
///
- /// Built-in exception class.
+ /// Jin Exception.
///
- class JinException : public std::exception
+ class Exception : public std::exception
{
public:
- JinException();
- const char* what() const throw();
+
+ ///
+ /// Creates a new Exception according to printf-rules.
+ ///
+ /// @param fmt The format string (see printf).
+ ///
+ Exception(const char *fmt, ...);
+ virtual ~Exception() throw();
+
+ ///
+ /// Returns a string containing reason for the exception.
+ ///
+ /// @return A description of the exception.
+ ///
+ inline virtual const char *what() const throw()
+ {
+ return mMessage.c_str();
+ }
+
+ private:
+ ///
+ /// Exception message.
+ ///
+ std::string mMessage;
};