I'm using the Kohana 3.3 framework. I'm trying to disable the error messages for production machine.
我正在使用Kohana 3.3框架。我正在尝试禁用生产机器的错误消息。
The error message looks like : http://i.stack.imgur.com/dY2yD.png
错误消息如下所示:http://i.stack.imgur.com/dY2yD.png
In the production machine, I want to disable the debug tracking and the error message. I tried lots of ways but it didn't work.
在生产机器中,我想禁用调试跟踪和错误消息。我尝试了很多方法,但它没有用。
So, my question is: How can I disable the exception error messages ? Thanks.
所以,我的问题是:如何禁用异常错误消息?谢谢。
2 个解决方案
#1
1
Add this line in the bootstrap file:
在引导程序文件中添加以下行:
Kohana::init(array('errors' => FALSE));
Kohana :: init(array('errors'=> FALSE));
Kohana should now stop generating exceptions when an error happens.
Kohana现在应该在发生错误时停止生成异常。
Note:
注意:
This is highly discouraged by the Kohana development team and you should just catch the exceptions in a meaningfull way.
Kohana开发团队非常劝阻你,你应该以有意义的方式捕捉异常。
#2
0
You should leave errors on so you can use Kohana to catch your exceptions.
你应该留下错误,这样你就可以使用Kohana来捕捉你的异常。
So if we do it this way, there shouldn't ever be uncaught exceptions.
因此,如果我们这样做,就不应该有未被捕获的例外。
You can change the way Kohana manages http exceptions by setting
您可以通过设置更改Kohana管理http异常的方式
Kohana::$environment = Kohana::DEVELOPMENT
in bootstrap.php
在bootstrap.php中
#1
1
Add this line in the bootstrap file:
在引导程序文件中添加以下行:
Kohana::init(array('errors' => FALSE));
Kohana :: init(array('errors'=> FALSE));
Kohana should now stop generating exceptions when an error happens.
Kohana现在应该在发生错误时停止生成异常。
Note:
注意:
This is highly discouraged by the Kohana development team and you should just catch the exceptions in a meaningfull way.
Kohana开发团队非常劝阻你,你应该以有意义的方式捕捉异常。
#2
0
You should leave errors on so you can use Kohana to catch your exceptions.
你应该留下错误,这样你就可以使用Kohana来捕捉你的异常。
So if we do it this way, there shouldn't ever be uncaught exceptions.
因此,如果我们这样做,就不应该有未被捕获的例外。
You can change the way Kohana manages http exceptions by setting
您可以通过设置更改Kohana管理http异常的方式
Kohana::$environment = Kohana::DEVELOPMENT
in bootstrap.php
在bootstrap.php中