00001 /* 00002 Copyright (C) 2007 Butterfat, LLC (http://butterfat.net) 00003 00004 Permission is hereby granted, free of charge, to any person 00005 obtaining a copy of this software and associated documentation 00006 files (the "Software"), to deal in the Software without 00007 restriction, including without limitation the rights to use, 00008 copy, modify, merge, publish, distribute, sublicense, and/or sell 00009 copies of the Software, and to permit persons to whom the 00010 Software is furnished to do so, subject to the following 00011 conditions: 00012 00013 The above copyright notice and this permission notice shall be 00014 included in all copies or substantial portions of the Software. 00015 00016 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00017 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 00018 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00019 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 00020 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 00021 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 00022 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 00023 OTHER DEALINGS IN THE SOFTWARE. 00024 00025 Created by bmuller <bmuller@butterfat.net> 00026 */ 00027 00028 namespace stactiverecord { 00029 00030 class Sar_Exception : public std::exception { 00031 public: 00032 std::string _w; 00033 explicit Sar_Exception(const std::string &s) : _w(s) {}; 00034 virtual ~Sar_Exception() throw() {}; 00035 virtual const char * what() const throw() { return _w.c_str(); }; 00036 }; 00037 00041 class Sar_DBException : public Sar_Exception { 00042 public: 00043 Sar_DBException(std::string s) : Sar_Exception(s) {}; 00044 }; 00045 00049 class Sar_NoSuchObjectException : public Sar_Exception { 00050 public: 00051 Sar_NoSuchObjectException(std::string s) : Sar_Exception(s) {}; 00052 }; 00053 00057 class Sar_NoSuchPropertyException : public Sar_Exception { 00058 public: 00059 Sar_NoSuchPropertyException(std::string s) : Sar_Exception(s) {}; 00060 }; 00061 00065 class Sar_InvalidConfigurationException : public Sar_Exception { 00066 public: 00067 Sar_InvalidConfigurationException(std::string s) : Sar_Exception(s) {}; 00068 }; 00069 00073 class Sar_RecordNotFoundException : public Sar_Exception { 00074 public: 00075 Sar_RecordNotFoundException(std::string s) : Sar_Exception(s) {}; 00076 }; 00077 00081 class Sar_AssertionFailedException : public Sar_Exception { 00082 public: 00083 Sar_AssertionFailedException(std::string s) : Sar_Exception(s) {}; 00084 }; 00085 00089 class Sar_InvalidClassnameException : public Sar_Exception { 00090 public: 00091 Sar_InvalidClassnameException(std::string s) : Sar_Exception(s) {}; 00092 }; 00093 00098 class Sar_ColumnNotFoundException : public Sar_Exception { 00099 public: 00100 Sar_ColumnNotFoundException(std::string s) : Sar_Exception(s) {}; 00101 }; 00102 00103 class Sar_InvalidDateException : public Sar_Exception { 00104 public: 00105 Sar_InvalidDateException(std::string s) : Sar_Exception(s) {}; 00106 }; 00107 };