00001 /*************************************************************************** 00002 * File: ./exceptions.h 00003 * Author: Ronni Grapenthin, NORVULK & HU-BERLIN 00004 * Created: 23.04.2007 00005 * Licence: GPLv2 00006 * 00007 * ######################################################################### 00008 * 00009 * CrusDe, simulation framework for crustal deformation studies 00010 * Copyright (C) 2007 Ronni Grapenthin 00011 * 00012 * This program is free software; you can redistribute it and/or 00013 * modify it under the terms of the GNU General Public License 00014 * as published by the Free Software Foundation; version 2 00015 * of the License. 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU General Public License 00023 * along with this program; if not, write to the Free Software 00024 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00025 * 00026 ****************************************************************************/ 00027 00039 00040 #ifndef crusde_exceptions_h 00041 #define crusde_exceptions_h 00042 00043 #include <string> 00044 #include <stdexcept> 00045 00047 class SeriousException : public std::runtime_error { 00048 public: 00049 SeriousException(const std::string& s) 00050 : std::runtime_error(s) 00051 { } 00052 }; 00053 00055 class Conversion : public SeriousException { 00056 public: 00057 Conversion(const std::string& s) 00058 : SeriousException(s) 00059 { } 00060 }; 00061 00063 class FileNotFound : public SeriousException { 00064 public: 00065 FileNotFound(const std::string& s) 00066 : SeriousException(s) 00067 { } 00068 }; 00069 00071 class LibHandleError : public SeriousException { 00072 public: 00073 LibHandleError(const std::string& s) 00074 : SeriousException (s) 00075 { } 00076 }; 00077 00079 class DatabaseError : public std::runtime_error { 00080 public: 00081 DatabaseError(const std::string& s) 00082 : std::runtime_error(s) 00083 { } 00084 }; 00086 class PluginError : public std::runtime_error { 00087 public: 00088 PluginError(const std::string& s) 00089 : std::runtime_error(s) 00090 { } 00091 }; 00092 00094 class PluginExistsException : public std::runtime_error { 00095 public: 00096 PluginExistsException(const std::string& s) 00097 : std::runtime_error(s) 00098 { } 00099 }; 00100 #endif // crusde_exceptions_h