Skip to content

Commit 1b6f2a7

Browse files
corey-hammertondelgod
authored andcommitted
Fixing potential issues with the rmtree try-catch block
I've noticed that this except block isn't providing all logging as expected. This commit adds additional error logging. This commit also moves the exception string to the logging message instead of the error
1 parent 8661aa7 commit 1b6f2a7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mongodb_consistent_backup/Rotate.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def remove(self, ts):
4747
logging.debug("Removing backup path: %s" % backup["path"])
4848
rmtree(backup["path"])
4949
except Exception, e:
50-
raise OperationError("Unable to remove backup path %s. %s" % (backup["path"], e))
50+
logging.error("Unable to remove backup path %s. %s" % (backup["path"], str(e)))
51+
raise OperationError(e)
5152
if self.previous == backup:
5253
self.previous = None
5354
del self.backups[ts]

0 commit comments

Comments
 (0)