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  *-------------------------------------------------------------------------
00013  */
00014 #ifndef PQXX_EXCEPT_H
00015 #define PQXX_EXCEPT_H
00016 
00017 #include <string>
00018 #include <stdexcept>
00019 
00020 #include "pqxx/util.h"
00021 
00022 
00024 
00025 class PQXX_LIBEXPORT broken_connection : public PGSTD::runtime_error
00026 {
00027 public:
00028   broken_connection() : PGSTD::runtime_error("Connection to back end failed") {}
00029   explicit broken_connection(const PGSTD::string &whatarg) : 
00030     PGSTD::runtime_error(whatarg) {}
00031 };
00032 
00033 
00035 
00036 class PQXX_LIBEXPORT sql_error : public PGSTD::runtime_error
00037 {
00038   PGSTD::string m_Q;
00039 
00040 public:
00041   sql_error() : PGSTD::runtime_error("Failed query"), m_Q() {}
00042   sql_error(const PGSTD::string &whatarg) : 
00043         PGSTD::runtime_error(whatarg), m_Q() {}
00044   sql_error(const PGSTD::string &whatarg, const PGSTD::string &Q) :
00045         PGSTD::runtime_error(whatarg), m_Q(Q) { }
00046   virtual ~sql_error() throw () {}
00047 
00049   const PGSTD::string &query() const { return m_Q; }                    //[t56]
00050 };
00051 
00052 
00054 
00060 class PQXX_LIBEXPORT in_doubt_error : public PGSTD::runtime_error
00061 {
00062 public:
00063   explicit in_doubt_error(const PGSTD::string &whatarg) : 
00064         PGSTD::runtime_error(whatarg) {}
00065 };
00066 
00067 
00068 #endif
00069 

Generated on Sat May 24 02:03:11 2003 for libpqxx by doxygen1.3-rc3