00001 /* Copyright © 2005-2006 Roger Leigh <rleigh@debian.org> 00002 * 00003 * schroot is free software; you can redistribute it and/or modify it 00004 * under the terms of the GNU General Public License as published by 00005 * the Free Software Foundation; either version 2 of the License, or 00006 * (at your option) any later version. 00007 * 00008 * schroot is distributed in the hope that it will be useful, but 00009 * WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 * General Public License for more details. 00012 * 00013 * You should have received a copy of the GNU General Public License 00014 * along with this program; if not, write to the Free Software 00015 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 00016 * MA 02111-1307 USA 00017 * 00018 *********************************************************************/ 00019 00020 #ifndef SBUILD_ERROR_H 00021 #define SBUILD_ERROR_H 00022 00023 #include <stdexcept> 00024 00025 #include <boost/format.hpp> 00026 00027 namespace sbuild 00028 { 00029 00033 class runtime_error : public std::runtime_error 00034 { 00035 public: 00041 runtime_error (std::string const& error): 00042 std::runtime_error(error) 00043 {} 00044 00046 virtual ~runtime_error () throw () 00047 {} 00048 }; 00049 00053 template <typename T> 00054 class runtime_error_custom : public runtime_error 00055 { 00056 public: 00062 runtime_error_custom (std::string const& error): 00063 runtime_error(error) 00064 {} 00065 00071 runtime_error_custom (boost::format const& error): 00072 runtime_error(error.str()) 00073 {} 00074 00076 virtual ~runtime_error_custom () throw () 00077 {} 00078 }; 00079 00080 } 00081 00082 #endif /* SBUILD_ERROR_H */ 00083 00084 /* 00085 * Local Variables: 00086 * mode:C++ 00087 * End: 00088 */