Java: what information in error stack trace do we typically not wish to show users?

前端 未结 7 1027
悲&欢浪女
悲&欢浪女 2020-12-11 02:47

I\'m new to java and I\'m not that familiar with the formatting rules used by an error stack trace when it is thrown and subsequently displayed to an end-user of my web appl

7条回答
  •  既然无缘
    2020-12-11 03:27

    You should only show stack traces when your app is in debug mode. In production mode, you should show a generic error message (or implement an Exception.getUserFriendlyMessage())and log the error (provide a log id if possible).

提交回复
热议问题