daemon: Include stack trace information when an exception occurs in a
session state hook.
This commit is contained in:
parent
fc9a7c5759
commit
c8d5ec994a
1 changed files with 4 additions and 2 deletions
|
@ -13,6 +13,7 @@ that manages a CORE session.
|
|||
|
||||
import os, sys, tempfile, shutil, shlex, atexit, gc, pwd
|
||||
import threading, time, random
|
||||
import traceback
|
||||
|
||||
from core.api import coreapi
|
||||
if os.uname()[0] == "Linux":
|
||||
|
@ -331,8 +332,9 @@ class Session(object):
|
|||
hook(state)
|
||||
except Exception, e:
|
||||
self.warn("ERROR: exception occured when running %s state "
|
||||
"hook: %s: %s" % (coreapi.state_name(state),
|
||||
hook, e))
|
||||
"hook: %s: %s\n%s" % (coreapi.state_name(state),
|
||||
hook, e,
|
||||
traceback.format_exc()))
|
||||
|
||||
def add_state_hook(self, state, hook):
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue