如何关闭带有文件路径的错误提示消息

kspade

如何关闭带有文件路径的错误提示消息

SQLSTATE[HY000] [1044] Access denied for user 'jackppp'@'localhost' to database 'jackppp2' in /temp/webman/vendor/topthink/think-orm/src/db/PDOConnection.php:797
Stack trace:
#0 /temp/webman/vendor/topthink/think-orm/src/db/connector/Mysql.php(98): think\db\PDOConnection->getPDOStatement()
#1 [internal function]: think\db\connector\Mysql->getTables()
#2 /temp/webman/vendor/topthink/think-orm/src/DbManager.php(374): call_user_func_array()
#3 [internal function]: think\DbManager->__call()
#4 /temp/webman/vendor/topthink/think-container/src/Facade.php(96): call_user_func_array()
#5 /temp/webman/vendor/yzh52521/webman-task/src/Server.php(548): think\Facade::__callStatic()
#6 /temp/webman/vendor/yzh52521/webman-task/src/Server.php(537): yzh52521\Task\Server->getDbTables()
#7 /temp/webman/vendor/yzh52521/webman-task/src/Server.php(80): yzh52521\Task\Server->checkCrontabTables()
#8 /temp/webman/support/helpers.php(411): yzh52521\Task\Server->onWorkerStart()
#9 /temp/webman/support/helpers.php(463): worker_bind()
#10 /temp/webman/vendor/workerman/workerman/Worker.php(2454): {closure}()
#11 /temp/webman/vendor/workerman/workerman/Worker.php(1578): Workerman\Worker->run()
#12 /temp/webman/vendor/workerman/workerman/Worker.php(1420): Workerman\Worker::forkOneWorkerForLinux()
#13 /temp/webman/vendor/workerman/workerman/Worker.php(1394): Workerman\Worker::forkWorkersForLinux()
#14 /temp/webman/vendor/workerman/workerman/Worker.php(560): Workerman\Worker::forkWorkers()
#15 /temp/webman/vendor/workerman/webman-framework/src/support/App.php(124): Workerman\Worker::runAll()
#16 /temp/webman/vendor/webman/console/src/Commands/StartCommand.php(29): support\App::run()
#17 /temp/webman/vendor/symfony/console/Command/Command.php(291): Webman\Console\Commands\StartCommand->execute()
#18 /temp/webman/vendor/symfony/console/Application.php(1014): Symfony\Component\Console\Command\Command->run()
#19 /temp/webman/vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
#20 /temp/webman/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
#21 /temp/webman/webman(45): Symfony\Component\Console\Application->run()

我已经把 config/app 里面的 debug 设置为:false了

但是当程序报错的时候还是输出了带有文件路径的一系列错误信息

如何不输出这些带有文件路径的错误消息?

779 1 0
1个回答

xiuwang

你这个是自定义进程吧。自定义进程config/app配置里无效,
自定义进程得自己 try catch 捕获异常,然后想显示啥自己定

  • kspade 2023-02-06

    是自定义进程 但是我得 try catch 里面并没有输出错误信息 它也出错误啊

  • xiuwang 2023-02-06

    那可能是你try catch写的有问题,或者放的位置不对

  • kspade 2023-02-06

    config/plugin 下面的呢有效不?

  • xiuwang 2023-02-06

    不会看调用栈么?你的明显是onWorkerStart里抛异常了,在onWorkerStart里自己try catch下就搞定了

  • xiuwang 2023-02-06

    plugin明显是插件的配置,和你自定义进程更没给关系了

年代过于久远,无法发表回答
×
🔝