X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Flaunch.py;h=68ba4e006b6c6f299b469371e033546feaf3bf8b;hb=5595804ad7bc2eeb15db93efc129bf21d9a3cc77;hp=c548ce9246b33f9c3e6b574e7769246767f07294;hpb=31cb581a72f067990a5dc3917542d15505f86990;p=mpd-sima.git diff --git a/sima/launch.py b/sima/launch.py index c548ce9..68ba4e0 100644 --- a/sima/launch.py +++ b/sima/launch.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2013, 2014, 2015 kaliko +# Copyright (c) 2013, 2014, 2015, 2020 kaliko # # This file is part of sima # @@ -37,7 +37,7 @@ from .lib.logger import set_logger from .lib.simadb import SimaDB from .utils.config import ConfMan from .utils.startopt import StartOpt -from .utils.utils import exception_log, SigHup +from .utils.utils import exception_log, SigHup, MPDSimaException # core plugins from .plugins.core.history import History from .plugins.core.mpdoptions import MpdOptions @@ -117,7 +117,6 @@ def start(sopt, restart=False): # Loading internal plugins load_plugins(sima, 'internal') - # Loading contrib plugins load_plugins(sima, 'contrib') logger.info('plugins loaded, prioriy: %s', ' > '.join(map(str, sima.plugins))) @@ -143,10 +142,14 @@ def run(sopt, restart=False): Catches Unhandled exception """ # pylint: disable=broad-except + logger = logging.getLogger('sima') try: start(sopt, restart) except SigHup: # SigHup inherit from Exception run(sopt, True) + except MPDSimaException as err: + logger.error(err) + sys.exit(2) except Exception: # Unhandled exception exception_log()