Try/catch on error message formatting