- Timestamp:
- 09/19/07 17:41:53 (14 months ago)
- Location:
- branches/strict-xml-branch/plugins/input/postgis
- Files:
-
- 2 modified
-
connection.hpp (modified) (2 diffs)
-
connection_manager.hpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/strict-xml-branch/plugins/input/postgis/connection.hpp
r485 r532 26 26 #define CONNECTION_HPP 27 27 28 #include <mapnik/datasource.hpp> 29 28 30 extern "C" 29 31 { … … 42 44 { 43 45 conn_=PQconnectdb(connection_str.c_str()); 44 if (PQstatus(conn_) == CONNECTION_BAD)46 if (PQstatus(conn_) != CONNECTION_OK) 45 47 { 46 std::clog << "connection ["<< connection_str<< "] failed\n" 47 << PQerrorMessage(conn_)<< std::endl; 48 std::string s("PSQL error"); 49 if (conn_ ) 50 { 51 std::string msg = PQerrorMessage( conn_ ); 52 if ( ! msg.empty() ) 53 { 54 s += ":\n" + msg.substr( 0, msg.size() - 1 ); 55 } 56 } 57 throw mapnik::datasource_exception( s ); 48 58 } 49 59 } -
branches/strict-xml-branch/plugins/input/postgis/connection_manager.hpp
r485 r532 58 58 T* operator()() const 59 59 { 60 return new T(connection_string());60 return new T(connection_string()); 61 61 } 62 62
