Better exception when connecting an event (#201)

pull/172/merge
Disconnect3d 9 years ago committed by Zach Riggle
parent eff9f165f3
commit edf4737c91

@ -16,9 +16,11 @@ import traceback
import gdb import gdb
import pwndbg.color
import pwndbg.config import pwndbg.config
import pwndbg.stdio import pwndbg.stdio
debug = pwndbg.config.Parameter('debug-events', False, 'display internal event debugging info') debug = pwndbg.config.Parameter('debug-events', False, 'display internal event debugging info')
pause = 0 pause = 0
@ -119,6 +121,9 @@ def connect(func, event_handler, name=''):
try: try:
func() func()
except Exception as e: except Exception as e:
msg = "Exception during func={}.{} {!r}".format(func.__module__, func.__name__, a)
msg = pwndbg.color.red(msg)
print(msg, file=sys.stderr)
traceback.print_exc() traceback.print_exc()
raise e raise e

Loading…
Cancel
Save