Improve messages logged for exceptions