Dealing with exceptions, Logging and displaying error messages