From 2a105f1612407a73b13795274233cd6edd0ce509 Mon Sep 17 00:00:00 2001 From: djcb Date: Fri, 30 Mar 2012 19:02:07 +0300 Subject: [PATCH] * mu-util.h: fix catch-macro for the case where the GError is set already --- src/mu-util.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mu-util.h b/src/mu-util.h index 9721818b..8d796d46 100644 --- a/src/mu-util.h +++ b/src/mu-util.h @@ -301,9 +301,10 @@ typedef gpointer XapianEnquire; g_set_error ((GE),0,(E), "%s: xapian error '%s'", \ __FUNCTION__, xerr.get_msg().c_str()); \ } catch (...) { \ - g_set_error ((GE),0,(MU_ERROR_INTERNAL), \ + if ((GE)&&!(*(GE))) \ + g_set_error ((GE),0,(MU_ERROR_INTERNAL), \ "%s: caught exception", __FUNCTION__); \ - } + } #define MU_XAPIAN_CATCH_BLOCK_RETURN(R) \ @@ -323,7 +324,8 @@ typedef gpointer XapianEnquire; __FUNCTION__, xerr.get_msg().c_str()); \ return (R); \ } catch (...) { \ - g_set_error ((GE),0,(MU_ERROR_INTERNAL), \ + if ((GE)&&!(*(GE))) \ + g_set_error ((GE),0,(MU_ERROR_INTERNAL), \ "%s: caught exception", __FUNCTION__); \ return (R); \ }