00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
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; }           
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