Improve logging for non-existent categories in the database

Suggested by Chad in the review for 3a8d3b9e0.

Bug: T179423
Change-Id: I9286ae33bdb3b0b50aa6f1619402caa5486682e3
This commit is contained in:
Kunal Mehta 2017-11-22 23:05:04 -08:00
parent c78e1c8d75
commit 2c08143ed0

View file

@ -21,7 +21,7 @@
namespace MediaWiki\Linter;
use FormatJson;
use MWExceptionHandler;
use MediaWiki\Logger\LoggerFactory;
/**
* Database logic
@ -84,7 +84,10 @@ class Database {
try {
$name = ( new CategoryManager() )->getCategoryName( $row->linter_cat );
} catch ( MissingCategoryException $e ) {
MWExceptionHandler::logException( $e );
LoggerFactory::getInstance( 'Linter' )->error(
'Could not find name for id: {linter_cat}',
[ 'linter_cat' => $row->linter_cat ]
);
return false;
}
return new LintError(