From: kaliko Date: Sat, 8 Feb 2014 13:08:17 +0000 (+0100) Subject: Actually exit on error X-Git-Tag: mpd-sima/0.12.0pr3~10 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=cae35b4090eaeb8eec24c7ea77ec2311f3fc0608;p=mpd-sima.git Actually exit on error --- diff --git a/sima/core.py b/sima/core.py index adbefa2..8e075b0 100644 --- a/sima/core.py +++ b/sima/core.py @@ -33,6 +33,7 @@ class Sima(Daemon): except (PlayerError, PlayerUnHandledError) as err: self.log.error('Fails to connect player: {}'.format(err)) self.shutdown() + sys.exit(1) self.short_history = deque(maxlen=60) def __get_player(self): diff --git a/sima/launch.py b/sima/launch.py index dbd1525..24802bf 100644 --- a/sima/launch.py +++ b/sima/launch.py @@ -42,11 +42,13 @@ def load_plugins(sima, source): except ImportError as err: logger.error('Failed to load plugin\'s module: {0} ({1})'.format(module, err)) sima.shutdown() + sys.exit(1) try: plugin_obj = getattr(mod_obj, plugin) except AttributeError as err: logger.error('Failed to load plugin {0} ({1})'.format(plugin, err)) sima.shutdown() + sys.exit(1) logger.info('Loading {0} plugin: {name} ({doc})'.format(source, **plugin_obj.info())) sima.register_plugin(plugin_obj)