Page MenuHomePhabricator

Errors in Wikibase REST API
Closed, ResolvedPublic

Description

This tracks the bigger effort on providing prioritized, clear, robust and useful feedback to the clients working with Wikibase REST API.

Efforts are going to be made in an iterative manner, aiming to gradual work towards the satisfactory level of API feedback. Those individual efforts will be tracked as sub-tasks.

Related Objects

StatusSubtypeAssignedTask
ResolvedIfrahkhanyaree_WMDE
ResolvedOllie.Shotton_WMDE
InvalidJakob_WMDE
ResolvedSilvan_WMDE
ResolvedOllie.Shotton_WMDE
ResolvedJakob_WMDE
ResolvedJakob_WMDE
InvalidSilvan_WMDE
ResolvedOllie.Shotton_WMDE
InvalidJakob_WMDE
ResolvedWMDE-leszek
ResolvedOllie.Shotton_WMDE
ResolvedJakob_WMDE
ResolvedOllie.Shotton_WMDE
ResolvedOllie.Shotton_WMDE
ResolvedJakob_WMDE
ResolvedSilvan_WMDE
ResolvedJakob_WMDE
ResolvedJakob_WMDE
ResolvedOllie.Shotton_WMDE
ResolvedJakob_WMDE
ResolvedJakob_WMDE
ResolvedSilvan_WMDE
InvalidNone
InvalidNone
ResolvedBUG REPORTDima_Koushha_WMDE
ResolvedOllie.Shotton_WMDE
ResolvedMuhammad_Yasser_Jazirahly_WMDE
InvalidNone
OpenNone
InvalidNone
ResolvedIfrahkhanyaree_WMDE
ResolvedIfrahkhanyaree_WMDE
ResolvedDima_Koushha_WMDE
ResolvedJakob_WMDE
ResolvedMuhammad_Yasser_Jazirahly_WMDE
ResolvedMuhammad_Yasser_Jazirahly_WMDE
ResolvedJakob_WMDE
InvalidNone
ResolvedDima_Koushha_WMDE
InvalidNone
InvalidNone
InvalidNone
InvalidBUG REPORTNone
InvalidBUG REPORTNone
OpenBUG REPORTNone
InvalidNone

Event Timeline

So I don't forget, I'm adding some of my ideas/suggestions for improving errors here. Let me know if there is a better place for this.

Make error messages more consistent. Especially around how {field}s are displayed.

  • statement-data-missing-field message
    • Mandatory field missing in the statement data: {field} -> Mandatory field '{field}' missing in the statement data
  • statement-data-invalid-field message
    • Invalid input for {field} -> Invalid input for field '{field}' or Invalid value for field '{field}'
  • patched-statement-missing-field message
    • Mandatory field missing in the patched statement: {field} -> Mandatory field '{field}' missing in the patched statement
  • patched-statement-invalid-field message
    • Invalid input for '{field}' in the patched statement -> Invalid value for field '{field}' in the patched statement

Make json-patch error codes more consistent

  • Be consistent with other "invalid" error messages (e.g. invalid-item-id):
    • invalid-patch-operation
    • invalid-patch-field-type
    • missing-json-patch-field -> invalid-patch-missing-field
  • or be consistent with statement-data-missing-field and statement-data-invalid-field:
    • invalid-patch-operation -> json-patch-invalid-operation (or json-patch-invalid-op)
    • invalid-patch-field-type -> json-patch-invalid-field-type
    • missing-json-patch-field -> json-patch-missing-field

Make error messages less verbose

  • patch-test-failed
    • Test operation in the provided patch failed. At path '{path}' expected '{json_encoded_value}', actual: '{json_encoded_actual}' could instead be one of:
      • -> Test operation failed at path '{path}'. Expected '{value}' to equal '{actual}'.
      • -> Test operation failed. Expected '{value}' to equal '{actual}' at path '{path}'.
      • -> Failed to assert '{value}' equals '{actual} at path '{path}' - do we need to repeat the error code and say "Test operation failed"?
      • -> any option above but just '{path}' instead of path '{path}'?

Add context to more error responses?
Not all error responses have a context field providing additional machine readable information about the error

Harm prevention mechanisms result in an unexpected error
We should return a specific error responses instead of an unexpected error

REST API error responses are inconsistent with Mediawiki error responses
See T313721