|author||Chris Wilson <email@example.com>||2015-12-22 21:24:16 +0000|
|committer||Chris Wilson <firstname.lastname@example.org>||2015-12-22 21:24:16 +0000|
Catch and log exceptions in the HousekeepStoreAccount destructor.
Destructors aren't supposed to throw exceptions, and they can be called while cleaning up from a previous exception, which will terminate the application, so just log the error and carry on.
Diffstat (limited to 'lib')
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/backupstore/HousekeepStoreAccount.cpp b/lib/backupstore/HousekeepStoreAccount.cpp
index e5bd3cbb..c965dd17 100644
@@ -81,7 +81,17 @@ HousekeepStoreAccount::~HousekeepStoreAccount()
+ // Discard() can throw exception, but destructors aren't supposed to do that, so
+ // just catch and log them.
+ catch(BoxException &e)
+ BOX_ERROR("Failed to destroy housekeeper: discarding the refcount "
+ "database threw an exception: " << e.what());