Although sending messages to a log file can be quite useful, there are often times when you would also like to display a user-friendly error message in the event of an unrecoverable exception.
虽然向一个日志文件发送消息相当有用,但是很多时候您可能还想在发生不可恢复的异常时显示一个用户友好的错误消息。
The error page can then display a friendly error message to the user, and then perhaps log the relevant exception information for the system administrator to review at a later time.
错误页面可以显示一个友好的信息给用户,然后可以将相关的异常信息写入日志以供管理员日后查看。
For example, if your application unsuccessfully tries to log in to a database, it should not display an error message that includes the user name it is using.
例如,如果您的应用程序尝试登录数据库时没有成功,则显示的错误信息不应该包括它正在使用的用户名。
应用推荐