Mediawiki 显示完整的错误描述

Mediawiki 显示完整的错误描述,mediawiki,Mediawiki,我正在开发一个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/htdoc

我正在开发一个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}

有没有办法知道隐藏在
后面的是什么,这样我就可以知道哪一列是未知的,例如?

我自己找到了答案。以下是捕获异常并显示它的代码:

try{
    $result = $this -> dbr -> select(...select code here...);
} 
catch (Exception $e){
    error_log($e->getMessage());
    ApiBase :: dieDebug( __METHOD__, $e->getMessage() );
}
然后错误以以下形式出现:

<error code="internal_api_error_MWException" info="error text">

我自己找到了答案。以下是捕获异常并显示它的代码:

try{
    $result = $this -> dbr -> select(...select code here...);
} 
catch (Exception $e){
    error_log($e->getMessage());
    ApiBase :: dieDebug( __METHOD__, $e->getMessage() );
}
然后错误以以下形式出现:

<error code="internal_api_error_MWException" info="error text">