Page MenuHomePhabricator

๐Ÿ”Ž๏ธ [Generalised error] Requested resource not found
Closed, ResolvedPublic5 Estimated Story Points

Description

Acceptance criteria:

  • Current messages it will replace:
    • Item/Property/Statement not found
    • label/description/aliases in a language not found for Item/Property
    • sitelink not found for site id (sitelink-not-defined)
  • HTTP status code: 404
  • Error code: resource-not-found
  • Error message: The requested resource does not exist
  • Error context: { "resource_type": "{resource_type}" }

resource_type: e.g. item, label, sitelink, ...

Event Timeline

Ifrahkhanyaree_WMDE renamed this task from [Generalised error] Resource-does-not-exist to [Generalised error] Resource not found.Aug 14 2024, 12:26 PM
Ifrahkhanyaree_WMDE updated the task description. (Show Details)
Ifrahkhanyaree_WMDE moved this task from To polish to Polished on the Wikibase Reuse Team board.
Ollie.Shotton_WMDE renamed this task from [Generalised error] Resource not found to [Generalised error] Requested resource not found.Aug 14 2024, 1:44 PM
Ollie.Shotton_WMDE subscribed.

I found something that's not ideal about the context.
For Item/Property/Statement it fine for the context to be { "parameter": "item_id" }, { "parameter": "property_id" }, or { "parameter": "statement_id" }.
For label/description/aliases in language, { "parameter": "language_code" } doesn't work as well - it's more the combination of item_id/property_id and language_code that is incorrect.
For sitelink not found for site id, { "parameter": "site_id" } also doesn't work - it's not the site with site_id that doesn't exist (that would result in an invalid-path-parameter error).

Given that the error is resource-not-found, I'm wondering if the context should instead be { "resource": "{resource}" } where {resource} is one of:

  • /entities/{item_id}
  • /entities/{property_id}
  • /entities/{statement_id}
  • /entities/{item_id}/labels/{language_code}
  • /entities/{item_id}/descriptions/{language_code}
  • /entities/{item_id}/aliases/{language_code}
  • /entities/{item_id}/sitelinks/{site_id}

I'll bring this up in the daily.

Task Breakdown Notes

create one subtask for each:

  • Item/Property not found
  • Statement not found
  • label/descriptiom/aliases in a language not defined for Items/Properties
  • sitelink not found for site id (sitelink-not-defined)

Note: pls do not forget to modify the OpenAPI specification

Silvan_WMDE renamed this task from [Generalised error] Requested resource not found to ๐Ÿ”Ž๏ธ [Generalised error] Requested resource not found.Sep 3 2024, 2:09 PM