summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2016-10-29 11:04:10 +0300
committerLars Wirzenius <liw@liw.fi>2016-10-29 11:04:10 +0300
commit99adb16b5c8fd095124800384ab43e0f8fa9f0c7 (patch)
tree70e54c9931f7ba6f9ec97efd8442d535fed5287c
parent318732151e5f1aa7a558a185fcdb17ba1dc980d8 (diff)
downloadobnam-99adb16b5c8fd095124800384ab43e0f8fa9f0c7.tar.gz
Fix list-errors so it doesn't crash
-rw-r--r--NEWS4
-rw-r--r--obnamlib/plugins/list_errors_plugin.py3
2 files changed, 6 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index c1f69527..9ce0cb94 100644
--- a/NEWS
+++ b/NEWS
@@ -65,6 +65,10 @@ Bug fixes:
* Lars Wirzenius fixed `obnam restore` to require a target set with
`--to`. Jonathan Dowland reported the problem.
+* Lars Wirzeniud fixed `obnam list-errors` so that it doesn't crash on
+ error classes that only exist to make the exception hierarchy
+ neater, such as `EncryptionError`. Bug reported by Rik Theys.
+
Version 1.19.1, released 2016-01-30
---------------------------------
diff --git a/obnamlib/plugins/list_errors_plugin.py b/obnamlib/plugins/list_errors_plugin.py
index 9e4bdd5c..519bddbf 100644
--- a/obnamlib/plugins/list_errors_plugin.py
+++ b/obnamlib/plugins/list_errors_plugin.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2015 Lars Wirzenius
+# Copyright (C) 2015-2016 Lars Wirzenius
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -27,6 +27,7 @@ class ListErrorsPlugin(obnamlib.ObnamPlugin):
def list_errors(self, args):
errors = obnamlib.find_structured_errors(obnamlib, self.app.pluginmgr)
+ errors = [e for e in errors if e.msg]
f = self.app.output
f.write('## By error code\n\n')