如何很好地告知用户发生了未知错误?

发布于 2024-09-02 23:08:43 字数 269 浏览 7 评论 0原文

错误报告有多种准则,通常基于在用户做错事时向用户提供有用的信息,但要提供此类信息,您需要处理错误并知道错误可能会发生。还有大量关于设计 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

半步萧音过轻尘 2024-09-09 23:08:43

发生错误时要记住的第一件事:不要吓到或迷惑您的用户。

  1. 您的错误页面应该以无缝的方式集成到您的网站中:相似的布局,相同的颜色。很明显,该页面是您网站的一部分,并且是先前操作的结果。
  2. 正如 Matthew Wilson 和 codymanix 所说,你不应该太技术化。错误消息必须清晰易懂。如果你不知道错误从何而来,就直接说出来。
  3. 如果在任何类型的交易期间发生错误,您应该告知用户后果。如果错误中断了在线订单,您应该能够判断交易是否已进行。

现在您已经告诉用户发生了一些不好的事情,是时候通知开发人员了。有很多解决方案,包括:

  1. 自定义错误日志
  2. 操作系统提供的错误日志(例如 Windows 的事件日志)
  3. 电子邮件警报

First thing to keep in mind when an error happens : do not frighten or confuse your users.

  1. Your error pages should integrate into your site in a seamless way : similar layout, same colors. It should be obvious that this page is part of your site and is a consequence of a previous action.
  2. As Matthew Wilson and codymanix said, you should not be too technical. Error messages must be clear and intelligible. If you do not know where the error comes from, just say it.
  3. If the error happened during a transaction of any kind, you should inform the user about the consequences. If an error interrupts an online order, you should be able to tell if the transaction has been carried out or not.

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 :

  1. Custom error log
  2. OS-provided error log (such as Windows' Event Log)
  3. E-mail alerts
合久必婚 2024-09-09 23:08:43

“抱歉,发生了意外错误”,后面是有关如何恢复的可能提示(刷新页面/清除 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.

情泪▽动烟 2024-09-09 23:08:43

在这种情况下应该显示什么标题消息?像“抱歉,发生意外错误”之类的内容就足够了吗?

文本应为“发生错误,这是你的错!”

应提供哪些信息?

关于未知错误,您可以提供哪些信息?

是否应该有机制来帮助向开发人员报告失败?哪些?

不!切勿报告错误或记录日志!我可以导致修复错误的能力!

xD

What header message should be shown in that case? something like "Sorry, an unexpected error has ocurred" would be enough?

The text should read like "An error occurred and it's your fault!"

What information should be given?

What Information could you give about an unknown error?

Should it have mechanisms to help to report the failure to developers? Which ones?

No! Never report errors nor do logging! I could lead to the ability to fix the error!

x-D

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文