Some more logging to uncaught exceptions
This commit is contained in:
@@ -11,7 +11,8 @@ def runHandler(name, handler, *args, **kwargs):
|
|||||||
try:
|
try:
|
||||||
return handler(*args, **kwargs)
|
return handler(*args, **kwargs)
|
||||||
except:
|
except:
|
||||||
log.error('Error in event "%s", that wasn\'nt caught: %s' % (name, traceback.format_exc()))
|
from couchpotato.environment import Env
|
||||||
|
log.error('Error in event "%s", that wasn\'nt caught: %s%s' % (name, traceback.format_exc(), Env.all()))
|
||||||
|
|
||||||
def addEvent(name, handler, priority = 100):
|
def addEvent(name, handler, priority = 100):
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,14 @@ class Env(object):
|
|||||||
def get(attr):
|
def get(attr):
|
||||||
return getattr(Env, '_' + attr)
|
return getattr(Env, '_' + attr)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def all():
|
||||||
|
ret = ''
|
||||||
|
for attr in ['encoding', 'debug', 'args', 'app_dir', 'data_dir', 'desktop', 'options']:
|
||||||
|
ret += '%s=%s ' % (attr, Env.get(attr))
|
||||||
|
|
||||||
|
return ret
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def set(attr, value):
|
def set(attr, value):
|
||||||
return setattr(Env, '_' + attr, value)
|
return setattr(Env, '_' + attr, value)
|
||||||
|
|||||||
Reference in New Issue
Block a user