[PATCH 2/4] lib: add notmuch_database_reopen

David Bremner david at tethera.net
Sat Feb 25 12:11:16 PST 2017


Jani Nikula <jani at nikula.org> writes:

> On Fri, 24 Feb 2017, David Bremner <david at tethera.net> wrote:
>> The main expected use is to recover from a Xapian::DatabaseChanged
>> exception.
>
> I guess the main question here is if this should be exposed from the
> library or not. If the intention is to recover *within* the library, why
> add new API?

Yes that would work. Although as I mentioned on IRC, the API has been
proposed a few times before. I don't mind either way, it could always be
exposed later. In particular then I could feel less guilty about not yet
providing any bindings.

>> +	notmuch->xapian_db->reopen ();
>> +    } catch (const Xapian::Error &error) {
>> +	if (! notmuch->exception_reported) {
>> +	    _notmuch_database_log (notmuch, "Error: A Xapian exception reopening database: %s\n",
>> +				   error.get_msg ().c_str ());
>> +	    notmuch->exception_reported = TRUE;
>> +	    return NOTMUCH_STATUS_XAPIAN_EXCEPTION;
>> +	}
>
> Move the above return out of the if block?

oh duh. good catch.


More information about the notmuch mailing list