显示完整的错误描述
我正在以 API 扩展的形式开发 MediaWiki 1.16 的扩展。我正在使用数据库访问函数 wfGetDB
,但我发现很难调试,因为即使在 LocalSettings.php
中包含以下几行,也不会显示完整的错误消息
error_reporting( E_ALL );
ini_set('display_errors', 1);
//... rest of the file ...
$wgShowExceptionDetails = true;
:是我得到的堆栈的一个示例:
#0 /srv/www/htdocs/wotp/cd/includes/db/Database.php(538): DatabaseBase->reportQueryError('Unknown column ...', 1054, 'SELECT languag...', 'cdDictList::exe...', false)
#1 /srv/www/htdocs/wotp/cd/includes/db/Database.php(874): DatabaseBase->query('SELECT languag...', 'cdDictList::exe...')
#2 /srv/www/htdocs/wotp/cd/extensions/CommunityDictionary/includes/cdDictList.class.php(30): DatabaseBase->select('user_dictionary...', Array, Array, 'cdDictList::exe...', Array, Array)
#3 /srv/www/htdocs/wotp/cd/includes/api/ApiMain.php(595): cdDictList->execute()
#4 /srv/www/htdocs/wotp/cd/includes/api/ApiMain.php(338): ApiMain->executeAction()
#5 /srv/www/htdocs/wotp/cd/includes/api/ApiMain.php(322): ApiMain->executeActionWithErrorHandling()
#6 /srv/www/htdocs/wotp/cd/api.php(115): ApiMain->execute()
#7 {main}
有没有办法知道 ...
后面隐藏了什么,以便我可以知道哪一列是未知的?
I am developing an extension for MediaWiki 1.16 in the form of an API extension. I'm using the database access function wfGetDB
but I find it hard to debug because the full error messages are not displayed even by including the following lines in LocalSettings.php
:
error_reporting( E_ALL );
ini_set('display_errors', 1);
//... rest of the file ...
$wgShowExceptionDetails = true;
Here is an example of the stack I get:
#0 /srv/www/htdocs/wotp/cd/includes/db/Database.php(538): DatabaseBase->reportQueryError('Unknown column ...', 1054, 'SELECT languag...', 'cdDictList::exe...', false)
#1 /srv/www/htdocs/wotp/cd/includes/db/Database.php(874): DatabaseBase->query('SELECT languag...', 'cdDictList::exe...')
#2 /srv/www/htdocs/wotp/cd/extensions/CommunityDictionary/includes/cdDictList.class.php(30): DatabaseBase->select('user_dictionary...', Array, Array, 'cdDictList::exe...', Array, Array)
#3 /srv/www/htdocs/wotp/cd/includes/api/ApiMain.php(595): cdDictList->execute()
#4 /srv/www/htdocs/wotp/cd/includes/api/ApiMain.php(338): ApiMain->executeAction()
#5 /srv/www/htdocs/wotp/cd/includes/api/ApiMain.php(322): ApiMain->executeActionWithErrorHandling()
#6 /srv/www/htdocs/wotp/cd/api.php(115): ApiMain->execute()
#7 {main}
Is there a way to know what is hiding behind the ...
so I can know which column is unknown for example?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我自己找到了答案。下面是捕获异常并显示它的代码:
然后错误以这种形式出现:
I found the answer myself. Here is the code to catch the exception and display it:
The error then comes in this form: