]> kaliko git repositories - mpd-sima.git/blobdiff - sima/utils/utils.py
Tags plugin configuration check and test
[mpd-sima.git] / sima / utils / utils.py
index 2cb7c357a8dbd080405031e17281298dc8a07ea5..429b0f9befcce12e7283a5414d155474383afc76 100644 (file)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright (c) 2010, 2011, 2013, 2014, 2015 Jack Kaliko <kaliko@azylum.org>
+# Copyright (c) 2010, 2011, 2013, 2014, 2015, 2020 kaliko <kaliko@azylum.org>
 #
 #  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