make sure we return the correct error with the last traceback.

fix #630