diff --git a/plugins/input/postgis/connection.hpp b/plugins/input/postgis/connection.hpp index 2f96f4365..1ba568a96 100644 --- a/plugins/input/postgis/connection.hpp +++ b/plugins/input/postgis/connection.hpp @@ -95,7 +95,8 @@ public: } if(!result || (PQresultStatus(result) != PGRES_TUPLES_OK)) { - std::ostringstream s("Postgis Plugin: PSQL error"); + std::ostringstream s; + s << "Postgis Plugin: PSQL error"; if (conn_ ) { std::string msg = PQerrorMessage( conn_ ); @@ -106,6 +107,10 @@ public: s << "\nFull sql was: '" << sql << "'\n"; } + else + { + s << "unable to connect to database"; + } if (result) PQclear(result); throw mapnik::datasource_exception( s.str() );