00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
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
00048 const PGSTD::string &query() const { return m_Q; }
00049 };
00050
00051
00053
00059 class PQXX_LIBEXPORT in_doubt_error : public PGSTD::runtime_error
00060 {
00061 public:
00062 explicit in_doubt_error(const PGSTD::string &whatarg) :
00063 PGSTD::runtime_error(whatarg) {}
00064 };
00065
00066
00067 #endif
00068