Image patch (https://gerrit.wikimedia.org/r/#/c/57817/) is missing error handling when the mw API is queried to get information about an image.
Two kind of errors that handleResponse in LinkHandler.js has to deal with:
(1) API error: Given that ApiRequest retries, an api error is an indication that the api may be temporarily down or that something else is wrong. So, rather than continue, it is better to abort processing and return an error code to the clients so they can handle it however they want (ex: ve might tell the user that the page cannot be edited right now because of api/server issues). This will require calling the error callback found in env.
(2) Image missing: If the api comes back and tells us that the image is missing, we should handle this similar to how the PHP parser does it for missing images.
- Maybe link to a special page/url that will let VE present an upload handler (check with VE folks as to what this url could be. PHP parser behavior can be found by editing a page on wikipedia sandbox with a non-existent image)
- Dont add a thumb.
- Add a special rdf type on the image/wrapper tag: mw:Image/Missing maybe?