Merge pull request #2174 from strk/2.2.x-handle-bad-connection

Make sure status() returns a message also on bad connection
This commit is contained in:
Dane Springmeyer 2014-03-09 21:02:11 -07:00
commit 44ef0324f0

View file

@ -128,7 +128,8 @@ public:
std::string status; std::string status;
if (conn_) if (conn_)
{ {
status = PQerrorMessage(conn_); if ( isOK() ) return PQerrorMessage(conn_);
else return "Bad connection";
} }
else else
{ {