Better error reporting logic.

Mon, 05 Feb 2018 18:34:08 +0000

author
Tuomo Valkonen <tuomov@iki.fi>
date
Mon, 05 Feb 2018 18:34:08 +0000
changeset 109
246190bfd501
parent 108
6409aa77ddd5
child 110
a79409c72565

Better error reporting logic.

borgend/backup.py file | annotate | diff | comparison | revisions
--- a/borgend/backup.py	Mon Feb 05 18:32:36 2018 +0000
+++ b/borgend/backup.py	Mon Feb 05 18:34:08 2018 +0000
@@ -100,19 +100,19 @@
 class Status(Operation):
     def __init__(self, backup, op=None):
         op=backup.current_operation
-        errorsop=backup.previous_operation
+        errorsop=backup.current_operation
 
         if not op:
             op=backup.scheduled_operation
 
+        if not errorsop:
+            errorsop=backup.previous_operation
+
         if op:
             super().__init__(op.type, op.start_time, **op.detail)
         else:
             super().__init__(None, None)
 
-        if not errorsop:
-            errorsop=op
-
         if errorsop:
             self.errors=errorsop.errors
 

mercurial