Browse Source

Some more logging to uncaught exceptions

pull/69/head
Ruud 14 years ago
parent
commit
e9094d4c6c
  1. 3
      couchpotato/core/event.py
  2. 8
      couchpotato/environment.py

3
couchpotato/core/event.py

@ -11,7 +11,8 @@ def runHandler(name, handler, *args, **kwargs):
try:
return handler(*args, **kwargs)
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):

8
couchpotato/environment.py

@ -33,6 +33,14 @@ class Env(object):
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
def set(attr, value):
return setattr(Env, '_' + attr, value)

Loading…
Cancel
Save