gpt4 book ai didi

error-handling - 使错误更常见于10月的cms

转载 作者:行者123 更新时间:2023-12-03 07:57:40 26 4
gpt4 key购买 nike

我是编码新手。我正在尝试在十月厘米创建一个项目。
我的问题是关于错误处理。该错误似乎太有用,无法说明文件名。
例如
error example

我只想显示错误而不是文件。如何做到这一点。因此用户将看不到文件名。

最佳答案

为了实现这一点,您需要将debug内的config/app.php设置为false。当点击404或500时,将呈现通用页面。

然后,可以通过在CMS中创建/500(服务器错误)和/404(找不到页面)来覆盖这些模板。

从文档:

Debug mode

The debug setting is found in the config/app.php configuration file with the debug parameter and is enabled by default.

When enabled, this setting will show detailed error messages when they occur along with other debugging features. While useful during development, debug mode should always be disabled when used in a live production site. This prevents potentially sensitive information from being displayed to the end-user.

The debug mode uses the following features when enabled:

  • Detailed error pages are displayed.
  • Failed user authentication provides a specific reason.
  • Combined assets are not minified by default.
  • Safe mode is disabled by default.

Important: Always set the app.debug setting to false for production environments.



资料来源: https://octobercms.com/docs/setup/configuration#debug-mode

关于error-handling - 使错误更常见于10月的cms,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52361478/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com