Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | 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-2004, 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 <stdexcept>
00020 
00021 #include "pqxx/util"
00022 
00023 
00024 namespace pqxx
00025 {
00026 
00028 class PQXX_LIBEXPORT broken_connection : public PGSTD::runtime_error
00029 {
00030 public:
00031   broken_connection() : PGSTD::runtime_error("Connection to back end failed") {}
00032   explicit broken_connection(const PGSTD::string &whatarg) : 
00033     PGSTD::runtime_error(whatarg) {}
00034 };
00035 
00036 
00038 
00039 class PQXX_LIBEXPORT sql_error : public PGSTD::runtime_error
00040 {
00041   PGSTD::string m_Q;
00042 
00043 public:
00044   sql_error() : PGSTD::runtime_error("Failed query"), m_Q() {}
00045   explicit sql_error(const PGSTD::string &whatarg) : 
00046         PGSTD::runtime_error(whatarg), m_Q() {}
00047   sql_error(const PGSTD::string &whatarg, const PGSTD::string &Q) :
00048         PGSTD::runtime_error(whatarg), m_Q(Q) {}
00049   virtual ~sql_error() throw () {}
00050 
00052   const PGSTD::string &query() const throw () { return m_Q; }           //[t56]
00053 };
00054 
00055 
00057 
00063 class PQXX_LIBEXPORT in_doubt_error : public PGSTD::runtime_error
00064 {
00065 public:
00066   explicit in_doubt_error(const PGSTD::string &whatarg) : 
00067         PGSTD::runtime_error(whatarg) {}
00068 };
00069 
00070 }
00071 

Generated on Mon Nov 15 11:27:59 2004 for libpqxx by  doxygen 1.3.9.1