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