Catch errors and print the traceback on crashes