summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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());
+ }
}
}