// only image titles are allowed for the root in imageinfo mode
if ( !$this->hasNS && $this->rootTitle->getNamespace() !== NS_FILE ) {
- $this->dieUsage(
- "The title for {$this->getModuleName()} query must be a file",
+ $this->dieWithError(
+ [ 'apierror-imageusage-badtitle', $this->getModuleName() ],
'bad_image_title'
);
}