summaryrefslogtreecommitdiff
path: root/lib/backupstore
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2015-12-24 21:01:10 +0000
committerChris Wilson <chris+github@qwirx.com>2015-12-24 21:01:10 +0000
commit2fb99a5d3bc6d6d6fc26393090dccb4e8526771b (patch)
tree49ed9d3a88c18df26b44299f6fcdfc79cb904d86 /lib/backupstore
parent560966d7f4ec11962273eb7579f88d5f7e744298 (diff)
Catch exceptions during destruction of BackupStoreRefCountDatabase as well.
Like HousekeepStoreAccount and BackupStoreCheck, throwing an exception during the destructor will terminate the application in an "unusual way".
Diffstat (limited to 'lib/backupstore')
-rw-r--r--lib/backupstore/BackupStoreRefCountDatabase.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/backupstore/BackupStoreRefCountDatabase.cpp b/lib/backupstore/BackupStoreRefCountDatabase.cpp
index 8b51b70a..b2ea1abd 100644
--- a/lib/backupstore/BackupStoreRefCountDatabase.cpp
+++ b/lib/backupstore/BackupStoreRefCountDatabase.cpp
@@ -129,10 +129,18 @@ BackupStoreRefCountDatabase::~BackupStoreRefCountDatabase()
{
if (mIsTemporaryFile)
{
- THROW_EXCEPTION_MESSAGE(CommonException, Internal,
- "BackupStoreRefCountDatabase destroyed without "
+ // Don't throw exceptions in a destructor.
+ BOX_ERROR("BackupStoreRefCountDatabase destroyed without "
"explicit commit or discard");
- Discard();
+ try
+ {
+ Discard();
+ }
+ catch(BoxException &e)
+ {
+ BOX_LOG_SYS_ERROR("Failed to discard BackupStoreRefCountDatabase "
+ "in destructor: " << e.what());
+ }
}
}