X-Git-Url: http://git.kaliko.me/?a=blobdiff_plain;f=sima%2Futils%2Futils.py;h=429b0f9befcce12e7283a5414d155474383afc76;hb=aeacbd03b6efcd9fc163560030fdd2e7676a5794;hp=2cb7c357a8dbd080405031e17281298dc8a07ea5;hpb=1481a05d7060c8cfd615850b3df9d66a52fb0ff4;p=mpd-sima.git diff --git a/sima/utils/utils.py b/sima/utils/utils.py index 2cb7c35..429b0f9 100644 --- a/sima/utils/utils.py +++ b/sima/utils/utils.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (c) 2010, 2011, 2013, 2014, 2015 Jack Kaliko +# Copyright (c) 2010, 2011, 2013, 2014, 2015, 2020 kaliko # # This file is part of sima # @@ -22,6 +22,7 @@ """ # pylint: disable=C0111 +import logging import traceback import sys @@ -69,8 +70,7 @@ def normalize_path(path): def exception_log(): """Log unknown exceptions""" - import logging - log = logging.getLogger('sima') + log = logging.getLogger(__name__) log.error('Unhandled Exception!!!') log.error(''.join(traceback.format_exc())) log.info('Please report the previous message' @@ -165,9 +165,11 @@ class Throttle: return result return wrapper -# http client exceptions (for webservices) +class MPDSimaException(Exception): + pass -class WSError(Exception): +# http client exceptions (for webservices) +class WSError(MPDSimaException): pass class WSNotFound(WSError): @@ -179,6 +181,8 @@ class WSTimeout(WSError): class WSHTTPError(WSError): pass +class PluginException(MPDSimaException): + pass # VIM MODLINE # vim: ai ts=4 sw=4 sts=4 expandtab