00001 /* 00002 * The Mana World Server 00003 * Copyright 2004 The Mana World Development Team 00004 * 00005 * This file is part of The Mana World. 00006 * 00007 * The Mana World is free software; you can redistribute it and/or modify it 00008 * under the terms of the GNU General Public License as published by the Free 00009 * Software Foundation; either version 2 of the License, or any later version. 00010 * 00011 * The Mana World is distributed in the hope that it will be useful, but 00012 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 00013 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 00014 * more details. 00015 * 00016 * You should have received a copy of the GNU General Public License along 00017 * with The Mana World; if not, write to the Free Software Foundation, Inc., 00018 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 */ 00020 00021 #ifndef _TMWSERV_DAL_EXCEPT_H_ 00022 #define _TMWSERV_DAL_EXCEPT_H_ 00023 00024 00025 #include <string> 00026 00027 namespace dal 00028 { 00029 00030 00034 class DbException: public std::exception 00035 { 00036 public: 00042 DbException(const std::string& msg) 00043 throw() 00044 : mMsg(msg) 00045 { 00046 // NOOP 00047 } 00048 00049 00053 ~DbException(void) 00054 throw() 00055 { 00056 // NOOP 00057 } 00058 00059 00065 virtual const char* 00066 what(void) const 00067 throw() 00068 { 00069 return mMsg.c_str(); 00070 } 00071 00072 00073 private: 00074 std::string mMsg; 00075 }; 00076 00077 00081 class DbConnectionFailure: public DbException 00082 { 00083 public: 00087 DbConnectionFailure(void) 00088 throw() 00089 : DbException("") 00090 { 00091 // NOOP 00092 } 00093 00094 00100 DbConnectionFailure(const std::string& msg) 00101 throw() 00102 : DbException(msg) 00103 { 00104 // NOOP 00105 } 00106 }; 00107 00108 00112 class DbDisconnectionFailure: public DbException 00113 { 00114 public: 00118 DbDisconnectionFailure(void) 00119 throw() 00120 : DbException("") 00121 { 00122 // NOOP 00123 } 00124 00125 00131 DbDisconnectionFailure(const std::string& msg) 00132 throw() 00133 : DbException(msg) 00134 { 00135 // NOOP 00136 } 00137 }; 00138 00139 00143 class DbSqlQueryExecFailure: public DbException 00144 { 00145 public: 00149 DbSqlQueryExecFailure(void) 00150 throw() 00151 : DbException("") 00152 { 00153 // NOOP 00154 } 00155 00156 00162 DbSqlQueryExecFailure(const std::string& msg) 00163 throw() 00164 : DbException(msg) 00165 { 00166 // NOOP 00167 } 00168 }; 00169 00170 00174 class AlreadySetException: public std::exception 00175 { 00176 }; 00177 00178 00182 class RsColumnHeadersNotSet: public std::exception 00183 { 00184 }; 00185 00186 00187 } // namespace dal 00188 00189 #endif // _TMWSERV_DAL_EXCEPT_H_