I was quite frustrated debugging my callbacks mainly because I saw only the error message but python didn’t tell me in which line the exception occurred.
There might be an easier way but I found a workaround. Wrap your callback in a try-catch-block like this:
def my_callback():
try:
...normal code...
except Exception as e:
import traceback
traceback.print_exc()
raise e
In this way, the stack trace will be printed and the exception is forwarded as usual. Hope it helps somebody.

