00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <string>
00020 #include <stdexcept>
00021
00022 #include "pqxx/util"
00023
00024
00025 namespace pqxx
00026 {
00027
00029
00030 class PQXX_LIBEXPORT broken_connection : public PGSTD::runtime_error
00031 {
00032 public:
00033 broken_connection() : PGSTD::runtime_error("Connection to back end failed") {}
00034 explicit broken_connection(const PGSTD::string &whatarg) :
00035 PGSTD::runtime_error(whatarg) {}
00036 };
00037
00038
00040
00041 class PQXX_LIBEXPORT sql_error : public PGSTD::runtime_error
00042 {
00043 PGSTD::string m_Q;
00044
00045 public:
00046 sql_error() : PGSTD::runtime_error("Failed query"), m_Q() {}
00047 explicit sql_error(const PGSTD::string &whatarg) :
00048 PGSTD::runtime_error(whatarg), m_Q() {}
00049 sql_error(const PGSTD::string &whatarg, const PGSTD::string &Q) :
00050 PGSTD::runtime_error(whatarg), m_Q(Q) {}
00051 virtual ~sql_error() throw () {}
00052
00054 const PGSTD::string &query() const { return m_Q; }
00055 };
00056
00057
00059
00065 class PQXX_LIBEXPORT in_doubt_error : public PGSTD::runtime_error
00066 {
00067 public:
00068 explicit in_doubt_error(const PGSTD::string &whatarg) :
00069 PGSTD::runtime_error(whatarg) {}
00070 };
00071
00072 }
00073