// Clint - Source code checker for C++ // Copyright (C) 2001 David Pashley // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef __EXCEPTION_H__ #define __EXCEPTION_H__ #include #include #include namespace python { using std::exception; using std::logic_error; using std::string; class Exception : public logic_error { public: Exception (): logic_error ("Error in Python Interpreter") { } Exception (const string& what_arg): logic_error (std::string("python ") + what_arg) { } }; class StandardError : public Exception { public: StandardError (const string& what_arg): Exception (std::string("StandardError: ") + what_arg) { } }; class ArithmeticError : public Exception { public: ArithmeticError (const string& what_arg): Exception (std::string("ArithmeticError: ") + what_arg) { } }; class LookupError : public Exception { public: LookupError (const string& what_arg): Exception (std::string("LookupError: ") + what_arg) { } }; class AssertionError : public Exception { public: AssertionError (const string& what_arg): Exception (std::string("AssertionError: ") + what_arg) { } }; class AttributeError : public Exception { public: AttributeError (const string& what_arg): Exception (std::string("AttributeError: ") + what_arg) { } }; class EOFError : public Exception { public: EOFError (const string& what_arg): Exception (std::string("EOFError: ") + what_arg) { } }; class EnvironmentError : public Exception { public: EnvironmentError (const string& what_arg): Exception (std::string("EnviromentError: ") + what_arg) { } }; class FloatingPointError : public Exception { public: FloatingPointError (const string& what_arg): Exception (std::string("FloatingPointError: ") + what_arg) { } }; class IOError : public Exception { public: IOError (const string& what_arg): Exception (std::string("IOError: ") + what_arg) { } }; class ImportError : public Exception { public: ImportError (const string& what_arg): Exception (std::string("ImportError: ") + what_arg) { } }; class IndexError : public Exception { public: IndexError (const string& what_arg): Exception (std::string("IndexError: ") + what_arg) { } }; class KeyError : public Exception { public: KeyError (const string& what_arg): Exception (std::string("KeyError: ") + what_arg) { } }; class KeyboardInterrupt : public Exception { public: KeyboardInterrupt (const string& what_arg): Exception (std::string("KeyboardInterrupt") + what_arg) { } }; class MemoryError : public Exception { public: MemoryError (const string& what_arg): Exception (std::string("MemoryError: ") + what_arg) { } }; class NameError : public Exception { public: NameError (const string& what_arg): Exception (std::string("NameError: ") + what_arg) { } }; class NotImplementedError : public Exception { public: NotImplementedError (const string& what_arg): Exception (std::string("NotImplementedError: ") + what_arg) { } }; class OSError : public Exception { public: OSError (const string& what_arg): Exception (std::string("OSError: ") + what_arg) { } }; class OverflowError : public Exception { public: OverflowError (const string& what_arg): Exception (std::string("OverflowError: ") + what_arg) { } }; class RuntimeError : public Exception { public: RuntimeError (const string& what_arg): Exception (std::string("RuntimeError: ") + what_arg) { } }; class SyntaxError : public Exception { public: SyntaxError (const string& what_arg): Exception (std::string("SyntaxError: ") + what_arg) { } }; class SystemError : public Exception { public: SystemError (const string& what_arg): Exception (std::string("SystemError: ") + what_arg) { } }; class SystemExit : public Exception { public: SystemExit (const string& what_arg): Exception (std::string("SystemExit") + what_arg) { } }; class TypeError : public Exception { public: TypeError (const string& what_arg): Exception (std::string("TypeError: ") + what_arg) { } }; class ValueError : public Exception { public: ValueError (const string& what_arg): Exception (std::string("ValueError: ") + what_arg) { } }; class WindowsError : public Exception { public: WindowsError (const string& what_arg): Exception (std::string("WindowsError: ") + what_arg) { } }; class ZeroDivisionError : public Exception { public: ZeroDivisionError (const string& what_arg): Exception (std::string("ZeroDivisionError: ") + what_arg) { } }; } #endif // __EXCEPTION_H__