[PATCH v2 2/5] compact: catch Xapian::Error consistently

Jani Nikula jani at nikula.org
Thu Nov 14 06:13:41 PST 2013


The first two patches LGTM.

On Wed, 13 Nov 2013, Tomi Ollila <tomi.ollila at iki.fi> wrote:
> catch Xapian::Error in compact code in lib/database.cc to be consistent
> with other code in addition to not making software crash on uncaught
> other Xapian error.
> ---
>  lib/database.cc | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/database.cc b/lib/database.cc
> index 3c008d6..3530cb6 100644
> --- a/lib/database.cc
> +++ b/lib/database.cc
> @@ -918,8 +918,8 @@ notmuch_database_compact (const char *path,
>  	compactor.add_source (xapian_path);
>  	compactor.set_destdir (compact_xapian_path);
>  	compactor.compact ();
> -    } catch (Xapian::InvalidArgumentError e) {
> -	fprintf (stderr, "Error while compacting: %s\n", e.get_msg().c_str());
> +    } catch (const Xapian::Error &error) {
> +	fprintf (stderr, "Error while compacting: %s\n", error.get_msg().c_str());
>  	ret = NOTMUCH_STATUS_XAPIAN_EXCEPTION;
>  	goto DONE;
>      }
> -- 
> 1.8.3.1
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list