Page MenuHomePhabricator

Special:ExternalGuidance throws InvalidArgumentException instead of ErrorPageError for missing `service`
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error message
[1aa5d235-5cd1-48bd-ad4f-3431cc06d556] 2020-11-13 19:43:54: Fatal exception of type "InvalidArgumentException"
Stack Trace
[1aa5d235-5cd1-48bd-ad4f-3431cc06d556] /wiki/Special:ExternalGuidance?from=en&to=es&page=Example   InvalidArgumentException from line 75 of /srv/mediawiki/php-1.36.0-wmf.16/extensions/ExternalGuidance/includes/SpecialExternalGuidance.php: Invalid service name
#0 /srv/mediawiki/php-1.36.0-wmf.16/extensions/ExternalGuidance/includes/SpecialExternalGuidance.php(43): MediaWiki\Extension\ExternalGuidance\SpecialExternalGuidance->mtContextGuidance(WebRequest, OutputPage)
#1 /srv/mediawiki/php-1.36.0-wmf.16/includes/specialpage/SpecialPage.php(607): MediaWiki\Extension\ExternalGuidance\SpecialExternalGuidance->execute(NULL)
#2 /srv/mediawiki/php-1.36.0-wmf.16/includes/specialpage/SpecialPageFactory.php(1168): SpecialPage->run(NULL)
#3 /srv/mediawiki/php-1.36.0-wmf.16/includes/MediaWiki.php(310): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#4 /srv/mediawiki/php-1.36.0-wmf.16/includes/MediaWiki.php(943): MediaWiki->performRequest()
#5 /srv/mediawiki/php-1.36.0-wmf.16/includes/MediaWiki.php(546): MediaWiki->main()
#6 /srv/mediawiki/php-1.36.0-wmf.16/index.php(53): MediaWiki->run()
#7 /srv/mediawiki/php-1.36.0-wmf.16/index.php(46): wfIndexMain()
#8 /srv/mediawiki/w/index.php(3): require(string)
#9 {main}
Impact

User is shown an error with no explanation of what went wrong. InvalidArgumentException shouldn't be thrown for user-supplied arguments. Additionally, since there is already a message for missing required parameters, that should be used instead.

Details

Request ID
1aa5d235-5cd1-48bd-ad4f-3431cc06d556
Request URL
https://en.wikipedia.org/wiki/Special:ExternalGuidance?from=en&to=es&page=Example

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 640760 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/ExternalGuidance@master] Clean up Special:ExternalGuidance parameter handling

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

Change 640760 merged by jenkins-bot:
[mediawiki/extensions/ExternalGuidance@master] Clean up Special:ExternalGuidance parameter handling

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

I raised this issue last year in T216266. Glad to see it is now addressed for the remaining cases as well.