Tencent / Biny

Biny is a tiny, high-performance PHP framework for web applications
BSD 3-Clause "New" or "Revised" License
1.69k stars 258 forks source link

关于权限 privilege,错误能不显示吗? #40

Closed afisme closed 7 years ago

afisme commented 7 years ago
Fatal error:  privilege [login_required] is not access [非法请求] in D:\htdocs\chatWeb\lib\business\TXAction.php:123
Stack trace:
#0 D:\htdocs\chatWeb\lib\business\TXAction.php(79): biny\lib\TXAction->valid_privilege()
#1 D:\htdocs\chatWeb\lib\business\TXFactory.php(68): biny\lib\TXAction->__construct()
#2 D:\htdocs\chatWeb\lib\business\TXFactory.php(45): biny\lib\TXFactory::loadClass('adminAction', 'adminAction')
#3 D:\htdocs\chatWeb\lib\business\TXRequest.php(232): biny\lib\TXFactory::create('adminAction')
#4 D:\htdocs\chatWeb\lib\business\TXController.php(54): biny\lib\TXRequest->getModule(true)
#5 D:\htdocs\chatWeb\lib\business\TXController.php(42): biny\lib\TXController->call(Object(biny\lib\TXRequest))
#6 D:\htdocs\chatWeb\lib\business\TXController.php(105): biny\lib\TXController->execute()
#7 D:\htdocs\chatWeb\lib\TXApp.php(177): biny\lib\TXController->dispatcher()
#8 D:\htdocs\chatWeb\web\index.php(21): TXApp::run()
#9 {main}

这个错误信息能不显示吗?

billge1205 commented 7 years ago

其实是在报错前已经走了你的回调了 你可以在你的回调中die(); 终止掉 不终止的话系统会默认抛出异常 报错信息可以在index.php 中开关 SYS_DEBUG

billge1205 commented 7 years ago

非debug模式下 会返回一个error页面 在config.php中可以配置