00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __JackException__
00021 #define __JackException__
00022
00023 #include <stdexcept>
00024 #include <iostream>
00025 #include <string>
00026 #include "JackCompilerDeps.h"
00027 #include "JackError.h"
00028
00029 namespace Jack
00030 {
00031
00036 class SERVER_EXPORT JackException : public std::runtime_error {
00037
00038 public:
00039
00040 JackException(const std::string& msg) : std::runtime_error(msg)
00041 {}
00042 JackException(char* msg) : std::runtime_error(msg)
00043 {}
00044 JackException(const char* msg) : std::runtime_error(msg)
00045 {}
00046
00047 std::string Message()
00048 {
00049 return what();
00050 }
00051
00052 void PrintMessage()
00053 {
00054 std::string str = what();
00055 if (str != "")
00056 jack_info(str.c_str());
00057 }
00058 };
00059
00064 class SERVER_EXPORT JackNetException : public JackException {
00065
00066 public:
00067
00068 JackNetException(const std::string& msg) : JackException(msg)
00069 {}
00070 JackNetException(char* msg) : JackException(msg)
00071 {}
00072 JackNetException(const char* msg) : JackException(msg)
00073 {}
00074 JackNetException() : JackException("")
00075 {}
00076 };
00077
00078 }
00079
00080 #endif