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

except.h

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

Generated on Sat Jun 7 00:49:33 2003 for libpqxx by doxygen1.3-rc3