mirror of
https://github.com/mapnik/mapnik.git
synced 2025-12-08 20:13:09 +00:00
ensure proper error output from postgis plugin - refs #955
This commit is contained in:
parent
a6abfe5ff0
commit
e99e6da1e5
@ -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() );
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user