Correctly handle exceptions during callback handling.