diff options
author | Lars Wirzenius <liw@liw.fi> | 2014-02-15 21:40:55 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2014-02-15 21:40:55 +0000 |
commit | ad3270bd34fd062d99ac64a6a02d7f21a9cf946f (patch) | |
tree | 8f730949d374101c1e5dc1f14c5bab4923045e60 /obnamlib/plugins/restore_plugin.py | |
parent | 24cdf74c3a208e4ac75f38f4f883cc5e6e2bdd06 (diff) | |
download | obnam-ad3270bd34fd062d99ac64a6a02d7f21a9cf946f.tar.gz |
Convert restore plugin to StructuredError
Diffstat (limited to 'obnamlib/plugins/restore_plugin.py')
-rw-r--r-- | obnamlib/plugins/restore_plugin.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/obnamlib/plugins/restore_plugin.py b/obnamlib/plugins/restore_plugin.py index 9d913d25..caa5f2b7 100644 --- a/obnamlib/plugins/restore_plugin.py +++ b/obnamlib/plugins/restore_plugin.py @@ -24,6 +24,11 @@ import ttystatus import obnamlib +class WrongNumberOfGenerationSettingsError(obnamlib.ObnamError): + + msg = 'The restore command wants exactly one generation option' + + class Hardlinks(object): '''Keep track of inodes with unrestored hardlinks.''' @@ -133,8 +138,7 @@ class RestorePlugin(obnamlib.ObnamPlugin): generations = self.app.settings['generation'] if len(generations) != 1: - raise obnamlib.Error( - 'The restore command wants exactly one generation option') + raise WrongNumberOfGenerationSettingsError() gen = self.repo.interpret_generation_spec(client_name, generations[0]) self.configure_ttystatus() |