Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

except.hxx

Go to the documentation of this file.
00001 /*------------------------------------------------------------------------- 00002 * 00003 * FILE 00004 * pqxx/except.hxx 00005 * 00006 * DESCRIPTION 00007 * definition of libpqxx exception classes 00008 * pqxx::sql_error, pqxx::broken_connection, pqxx::in_doubt_error, ... 00009 * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/except instead. 00010 * 00011 * Copyright (c) 2003, Jeroen T. Vermeulen <jtv@xs4all.nl> 00012 * 00013 * See COPYING for copyright license. If you did not receive a file called 00014 * COPYING with this source code, please notify the distributor of this mistake, 00015 * or contact the author. 00016 * 00017 *------------------------------------------------------------------------- 00018 */ 00019 #include <string> 00020 #include <stdexcept> 00021 00022 #include "pqxx/util" 00023 00024 00025 namespace pqxx 00026 { 00027 00029 00030 class PQXX_LIBEXPORT broken_connection : public PGSTD::runtime_error 00031 { 00032 public: 00033 broken_connection() : PGSTD::runtime_error("Connection to back end failed") {} 00034 explicit broken_connection(const PGSTD::string &whatarg) : 00035 PGSTD::runtime_error(whatarg) {} 00036 }; 00037 00038 00040 00041 class PQXX_LIBEXPORT sql_error : public PGSTD::runtime_error 00042 { 00043 PGSTD::string m_Q; 00044 00045 public: 00046 sql_error() : PGSTD::runtime_error("Failed query"), m_Q() {} 00047 explicit sql_error(const PGSTD::string &whatarg) : 00048 PGSTD::runtime_error(whatarg), m_Q() {} 00049 sql_error(const PGSTD::string &whatarg, const PGSTD::string &Q) : 00050 PGSTD::runtime_error(whatarg), m_Q(Q) {} 00051 virtual ~sql_error() throw () {} 00052 00054 const PGSTD::string &query() const throw () { return m_Q; } //[t56] 00055 }; 00056 00057 00059 00065 class PQXX_LIBEXPORT in_doubt_error : public PGSTD::runtime_error 00066 { 00067 public: 00068 explicit in_doubt_error(const PGSTD::string &whatarg) : 00069 PGSTD::runtime_error(whatarg) {} 00070 }; 00071 00072 } 00073

Generated on Sun Jun 6 20:55:09 2004 for libpqxx by doxygen 1.3.7