Module: sip-router Branch: janakj/postgres Commit: cf7e9b08f3af0c1539d2cb545bf25f4ce78ebd83 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=cf7e9b08...
Author: Henning Westerholt henning.westerholt@1und1.de Committer: Henning Westerholt henning.westerholt@1und1.de Date: Wed Jan 7 14:20:45 2009 +0000
- improve two errors messages, inform the user that the query is aborted also on the 'warning' case, better format errors from driver
git-svn-id: https://openser.svn.sourceforge.net/svnroot/openser/trunk@5429 689a6050-402a-0410-94f2-e92a70836424
---
modules/db_postgres/km_dbase.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/modules/db_postgres/km_dbase.c b/modules/db_postgres/km_dbase.c index b02a5ad..da85c46 100644 --- a/modules/db_postgres/km_dbase.c +++ b/modules/db_postgres/km_dbase.c @@ -423,9 +423,8 @@ int db_postgres_store_result(const db_con_t* _con, db_res_t** _r) break; /* query failed */ case PGRES_FATAL_ERROR: - LM_ERR("%p - invalid query, execution aborted\n", _con); - LM_ERR("%p: %s\n", _con, PQresStatus(pqresult)); - LM_ERR("%p: %s\n", _con, PQresultErrorMessage(CON_RESULT(_con))); + LM_ERR("invalid query, execution aborted\n"); + LM_ERR("driver error: %s, %s\n", PQresStatus(pqresult), PQresultErrorMessage(CON_RESULT(_con))); db_free_result(*_r); *_r = 0; rc = -3; @@ -440,9 +439,8 @@ int db_postgres_store_result(const db_con_t* _con, db_res_t** _r) /* unexpected response */ case PGRES_BAD_RESPONSE: default: - LM_ERR("%p Probable invalid query\n", _con); - LM_ERR("%p: %s\n", _con, PQresStatus(pqresult)); - LM_ERR("%p: %s\n", _con, PQresultErrorMessage(CON_RESULT(_con))); + LM_ERR("probable invalid query, execution aborted\n"); + LM_ERR("driver message: %s, %s\n", PQresStatus(pqresult), PQresultErrorMessage(CON_RESULT(_con))); db_free_result(*_r); *_r = 0; rc = -4;