diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-12-02 21:21:57 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-12-02 21:21:57 +0000 |
commit | 2b560da989ca1809196389b1651f520ecca7667c (patch) | |
tree | 21e7179456ba5dd7ea399819032b44cc90c65c44 /libpqpp/connection.cpp | |
parent | Tidy up and alias glibmm and libxml++ refs (diff) | |
download | libdbpp-postgresql-2b560da989ca1809196389b1651f520ecca7667c.tar.bz2 libdbpp-postgresql-2b560da989ca1809196389b1651f520ecca7667c.tar.xz libdbpp-postgresql-2b560da989ca1809196389b1651f520ecca7667c.zip |
Propergate connection error details into DB::Error and add test
Diffstat (limited to 'libpqpp/connection.cpp')
-rw-r--r-- | libpqpp/connection.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libpqpp/connection.cpp b/libpqpp/connection.cpp index 98f9054..51aac63 100644 --- a/libpqpp/connection.cpp +++ b/libpqpp/connection.cpp @@ -18,7 +18,7 @@ PQ::Connection::Connection(const std::string & info) : rolledback(false) { if (PQstatus(conn) != CONNECTION_OK) { - throw ConnectionError(); + throw ConnectionError(conn); } PQsetNoticeProcessor(conn, noNoticeProcessor, NULL); } @@ -100,11 +100,11 @@ PQ::Connection::ping() const { if (PQstatus(conn) != CONNECTION_OK) { if (inTx()) { - throw ConnectionError(); + throw ConnectionError(conn); } PQreset(conn); if (PQstatus(conn) != CONNECTION_OK) { - throw ConnectionError(); + throw ConnectionError(conn); } } } |