From 99adb16b5c8fd095124800384ab43e0f8fa9f0c7 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 29 Oct 2016 11:04:10 +0300 Subject: Fix list-errors so it doesn't crash --- NEWS | 4 ++++ obnamlib/plugins/list_errors_plugin.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) 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') -- cgit v1.2.1