aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Common/je_exception.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-11-16 00:24:51 +0800
committerchai <chaifix@163.com>2018-11-16 00:24:51 +0800
commit831e814ce9bdb84e86c06c4a52008f6bdaaa00d6 (patch)
treef91fccc7d2628d6e0a39886134b2bb174f5eede4 /src/libjin/Common/je_exception.h
parent6dc75930fe5fe02f1af5489917752d315cf9e48f (diff)
*合并master到minimal分支
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;
};