Page MenuHomePhabricator

Bad JSONPath throws exceptions that are not caught
Closed, ResolvedPublic

Description

{{#get_web_data:}} with format=json with jsonpath and incorrect JSONPath in data throws an exception:

80e598ad4b43069953938b0d] /w/index.php?title=(skipped)&action=submit MWException from line 418 of /var/www/wiki/w/extensions/ExternalData/includes/EDJsonObject.php: Ошибка: неверная запись JSONPath $1.

Backtrace:

#0 /var/www/wiki/w/extensions/ExternalData/includes/EDJsonObject.php(134): EDJsonObject->getReal()
#1 /var/www/wiki/w/extensions/ExternalData/includes/parsers/EDParserJSONwithJSONPath.php(38): EDJsonObject->get()
#2 /var/www/wiki/w/extensions/ExternalData/includes/connectors/EDConnectorBase.php(119): EDParserJSONwithJSONPath->__invoke()
#3 /var/www/wiki/w/extensions/ExternalData/includes/connectors/EDConnectorGet.php(121): EDConnectorBase->parse()
#4 /var/www/wiki/w/extensions/ExternalData/includes/EDParserFunctions.php(79): EDConnectorGet->run()
#5 /var/www/wiki/w/extensions/ExternalData/includes/EDParserFunctions.php(101): EDParserFunctions::fetch()
#6 /var/www/wiki/w/includes/parser/Parser.php(3816): EDParserFunctions::getWebData()
#7 /var/www/wiki/w/includes/parser/Parser.php(3519): Parser->callParserFunction()
#8 /var/www/wiki/w/includes/parser/PPFrame_Hash.php(254): Parser->braceSubstitution()
#9 /var/www/wiki/w/includes/parser/Parser.php(3330): PPFrame_Hash->expand()
#10 /var/www/wiki/w/includes/parser/Parser.php(1489): Parser->replaceVariables()
#11 /var/www/wiki/w/includes/parser/Parser.php(593): Parser->internalParse()
#12 /var/www/wiki/w/includes/content/WikitextContent.php(368): Parser->parse()
#13 /var/www/wiki/w/includes/content/AbstractContent.php(555): WikitextContent->fillParserOutput()
#14 /var/www/wiki/w/includes/EditPage.php(4120): AbstractContent->getParserOutput()
#15 /var/www/wiki/w/includes/EditPage.php(4025): EditPage->doPreviewParse()
#16 /var/www/wiki/w/includes/EditPage.php(2811): EditPage->getPreviewText()
#17 /var/www/wiki/w/includes/EditPage.php(703): EditPage->showEditForm()
#18 /var/www/wiki/w/includes/actions/EditAction.php(55): EditPage->edit()
#19 /var/www/wiki/w/includes/actions/SubmitAction.php(38): EditAction->show()
#20 /var/www/wiki/w/includes/MediaWiki.php(511): SubmitAction->show()
#21 /var/www/wiki/w/includes/MediaWiki.php(302): MediaWiki->performAction()
#22 /var/www/wiki/w/includes/MediaWiki.php(854): MediaWiki->performRequest()
#23 /var/www/wiki/w/includes/MediaWiki.php(527): MediaWiki->main()
#24 /var/www/wiki/w/index.php(44): MediaWiki->run()
#25 {main}

Event Timeline

Change 629090 had a related patch set uploaded (by Alex Mashin; owner: mashin):
[mediawiki/extensions/ExternalData@master] Catch exceptions thrown by EDJsonObject::getReal()

https://gerrit.wikimedia.org/r/629090

Change 629090 merged by jenkins-bot:
[mediawiki/extensions/ExternalData@master] Catch exceptions thrown by EDJsonObject::getReal()

https://gerrit.wikimedia.org/r/629090