From f3b55d620eaec09be907d20c324a2af858021a6f Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Thu, 18 Oct 2007 19:29:42 +0000 Subject: [PATCH] ebl PQerrorMessage add a \n at the end of the message so i have removed the extra one Add error message handling to start_batch git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5756 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/cats/postgresql.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bacula/src/cats/postgresql.c b/bacula/src/cats/postgresql.c index 5f3d5bcb88..733074e279 100644 --- a/bacula/src/cats/postgresql.c +++ b/bacula/src/cats/postgresql.c @@ -666,6 +666,7 @@ int my_postgresql_batch_start(JCR *jcr, B_DB *mdb) return mdb->status; bail_out: + Mmsg1(&mdb->errmsg, _("error starting batch mode: %s"), PQerrorMessage(mdb->db)); mdb->status = 0; PQclear(mdb->result); mdb->result = NULL; @@ -695,7 +696,7 @@ int my_postgresql_batch_end(JCR *jcr, B_DB *mdb, const char *error) if (res <= 0) { Dmsg0(500, "we failed\n"); mdb->status = 0; - Mmsg1(&mdb->errmsg, _("error ending batch mode: %s\n"), PQerrorMessage(mdb->db)); + Mmsg1(&mdb->errmsg, _("error ending batch mode: %s"), PQerrorMessage(mdb->db)); } Dmsg0(500, "my_postgresql_batch_end finishing\n"); @@ -742,7 +743,7 @@ int my_postgresql_batch_insert(JCR *jcr, B_DB *mdb, ATTR_DBR *ar) if (res <= 0) { Dmsg0(500, "we failed\n"); mdb->status = 0; - Mmsg1(&mdb->errmsg, _("error ending batch mode: %s\n"), PQerrorMessage(mdb->db)); + Mmsg1(&mdb->errmsg, _("error ending batch mode: %s"), PQerrorMessage(mdb->db)); } Dmsg0(500, "my_postgresql_batch_insert finishing\n"); -- 2.39.5