introduce exception handling at top level of libnotmuch

David Bremner david at tethera.net
Mon Jun 29 18:14:07 PDT 2020


I know that some of you are not C++ fans, but at the moment this is
the cleanest fix I can think of to uncaught xapian exceptions causing
calls to the library to die. Floris reminded me of this recently with
the discussion about operations on closed databases, but cleaning up
the handling of exceptions in libnotmuch has been on my mind for a
while. It will be bit laborious so I did a few functions for
discussion purposes before getting too carried away.

There is still a certain amount of boilerplate with more or less
identical try/catch blocks (yes, I really miss scheme macros here). I
could mostly eliminate that with C++11 lambdas, but I wasn't sure the
result was more maintainable or nicer.

This is definitely targeted for post 0.30.




More information about the notmuch mailing list