mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 17:34:54 +01:00
lib: construct compactor within try block to catch any exceptions
Constructors may also throw exceptions. Catch them.
This commit is contained in:
parent
425e73e146
commit
8e4e537cee
1 changed files with 2 additions and 1 deletions
|
@ -864,7 +864,6 @@ notmuch_database_compact (const char* path,
|
|||
notmuch_compact_status_cb_t status_cb)
|
||||
{
|
||||
void *local = talloc_new (NULL);
|
||||
NotmuchCompactor compactor(status_cb);
|
||||
char *notmuch_path, *xapian_path, *compact_xapian_path;
|
||||
char *old_xapian_path = NULL;
|
||||
notmuch_status_t ret = NOTMUCH_STATUS_SUCCESS;
|
||||
|
@ -910,6 +909,8 @@ notmuch_database_compact (const char* path,
|
|||
}
|
||||
|
||||
try {
|
||||
NotmuchCompactor compactor(status_cb);
|
||||
|
||||
compactor.set_renumber(false);
|
||||
compactor.add_source(xapian_path);
|
||||
compactor.set_destdir(compact_xapian_path);
|
||||
|
|
Loading…
Reference in a new issue