From 0768666d941af819c8fc20fc872609d4107c7bd2 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 2 Dec 2015 21:21:57 +0000 Subject: Propergate connection error details into DB::Error and add test --- libpqpp/connection.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libpqpp/connection.cpp') 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); } } } -- cgit v1.2.3