Go to
- https://test.wikidata.org/w/rest.php/wikibase/v0/entities/items/Q123456789 (this item doesn't exist)
and the error looks like
{"code":"item-not-found","message":"Could not find an item with the ID: Q123456789"}
Go to
- https://test.wikidata.org/w/rest.php/wikibase/v0/entities/items/Q5/sitelinks (yes I know this doesn't work yet, but this is how I ran into this as I was trying to add support)
and the error looks like
{"messageTranslations":{"en":"The requested relative path (/wikibase/v0/entities/items/Q5/sitelinks) did not match any known handler"},"httpCode":404,"httpReason":"Not Found"}
What should have happened instead?:
I feel like the REST API should issue errors in a consistent format even for endpoints that don't exist (yet). A library should be able to gracefully detect if an endpoint isn't supported. Not a big deal but would be nice.
Software version : Whatever is live on Wikidata now
Other information (browser name/version, screenshots, etc.):