From e99e6da1e54385a87f8ce09cbecafb44eb37fd64 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 17 Nov 2011 11:36:16 -0800 Subject: [PATCH] ensure proper error output from postgis plugin - refs #955 --- plugins/input/postgis/connection.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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() );