如何很好地告知用户发生了未知错误?
错误报告有多种准则,通常基于在用户做错事时向用户提供有用的信息,但要提供此类信息,您需要处理错误并知道错误可能会发生。还有大量关于设计 404 错误页面的文章。但是,当软件故障引发新的、未处理的错误时,您该怎么办?
是否有一些关于如何将网站中完全意外的错误报告为意外错误 500 的指南?
在这种情况下应该显示什么标题消息?像“抱歉,发生了意外错误”这样的内容就足够了吗?
应该提供什么信息?
它是否应该有机制来帮助向开发人员报告失败?哪些?
There are several guidelines for error reporting, that are usually based on giving to the user useful information when he or she does something wrong, but to give this kind of information you need to be handling the error and know that it can happen. There are also tons of articles about designing 404 error pages. But, what can you do when it's a new, unhandled error provoked by a failure in the software?
Are there some guidelines about how to nicely report totally unexpected errors in a web site as an unexpected error 500?
What header message should be shown in that case? something like "Sorry, an unexpected error has ocurred" would be enough?
What information should be given?
Should it have mechanisms to help to report the failure to developers? Which ones?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
发生错误时要记住的第一件事:不要吓到或迷惑您的用户。
现在您已经告诉用户发生了一些不好的事情,是时候通知开发人员了。有很多解决方案,包括:
First thing to keep in mind when an error happens : do not frighten or confuse your users.
Now you have told your users something bad happened, it is time to inform the developers about it. There are plenty of solutions around, including :
“抱歉,发生了意外错误”,后面是有关如何恢复的可能提示(刷新页面/清除 cookie/重新启动浏览器等)。错误存储库的链接会对您有所帮助,但沮丧的用户不需要关注它。
如果您计划自动将故障报告回服务器,请确保用户了解并同意。
"Sorry, an unexpected error has ocurred" followed by possible tips on how to recover from it (refresh the page/clear cookies/restart browser etc). A link to your bug repository would be helpful to you, but frustrated users need not follow it.
If you plan to automatically report the failure back to your servers, make sure that users are aware of it and they agree with it.
文本应为“发生错误,这是你的错!”
关于未知错误,您可以提供哪些信息?
不!切勿报告错误或记录日志!我可以导致修复错误的能力!
xD
The text should read like "An error occurred and it's your fault!"
What Information could you give about an unknown error?
No! Never report errors nor do logging! I could lead to the ability to fix the error!
x-D