Improve invalid title error message

Include the text of the title being complained about when returning an
invalid title error from expandTemplate.

Change-Id: I2261f9574557c3ae514c39cea71f9777f8f9f431
This commit is contained in:
Jackmcbarn 2014-03-11 13:01:25 -04:00
parent 29452c9bef
commit 18f177a3a9

View file

@ -444,7 +444,7 @@ abstract class Scribunto_LuaEngine extends ScribuntoEngineBase {
$frame = $this->getFrameById( $frameId );
$title = Title::newFromText( $titleText, NS_TEMPLATE );
if ( !$title ) {
throw new Scribunto_LuaError( 'expandTemplate: invalid title' );
throw new Scribunto_LuaError( "expandTemplate: invalid title \"$titleText\"" );
}
if ( $frame->depth >= $this->parser->mOptions->getMaxTemplateDepth() ) {