Steps to reproduce:
Add a hook handler for the ArticleDelete hook that prevents deleting pages under some conditions (for reproducing on the beta cluster I used an abuse filter that prevents deletions by me, https://commons.wikimedia.beta.wmflabs.org/wiki/Special:AbuseFilter/103)
Try to delete a non-file page, and see an error message explaining the failure (deleting https://commons.wikimedia.beta.wmflabs.org/wiki/Testing gave me the standard abusefilter disallowed message, "Your action has triggered the Abuse Filter An automated filter has identified this edit as potentially unconstructive, and it has been disallowed. If this edit is constructive, please report this error.")
Try to delete a file, and see an error message that does not include the specific failure reason set by an extension (deleting https://commons.wikimedia.beta.wmflabs.org/wiki/File:Testing_a_bug.png gave me the cannotdelete interface message, but not the abusefilter disallowed message)
Expected result:
Whatever reason given by a hook that prevents file deletion should be shown, just like for non-files