Page MenuHomePhabricator

Inconssistent Error JSON Format From Wikibase REST API
Open, Needs TriagePublicBUG REPORT

Description

Go to

and the error looks like

{"code":"item-not-found","message":"Could not find an item with the ID: Q123456789"}

Go to

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.):

Event Timeline

Hi @BrokenSegue, I'm going to take this into our backlog and see whether we can pick it up when we're dealing with all things error message related. I'd also think this is more of a feature that should exist and less a bug? But, that's not too relevant. Thanks for sharing!