close
Page MenuHomePhabricator

[MEX] Refactor API error handling into ErrorObject
Closed, ResolvedPublic

Description

In T417797 wbui2025 was updated to render HTML API errors when available: Gerrit change

This works, but it is effectively duck typing and leaks knowledge of the internal error structure into UI code. As suggested in code review, this logic should live on ErrorObject instead.

Acceptance Criteria

  • Extend ErrorObject with a method such as getErrorHtml()
  • Add related helpers if required
  • Have callers check for ErrorObject and use its methods instead of reading nested fields directly
  • Update tests

Event Timeline

karapayneWMDE renamed this task from Refactor API error handling into ErrorObject to [MEX] Refactor API error handling into ErrorObject.May 8 2026, 9:58 AM
karapayneWMDE moved this task from Incoming to MEX Incoming column on the Wikidata-Omega board.

Change #1289320 had a related patch set uploaded (by Sadiya.mohammed13; author: Sadiya.mohammed13):

[mediawiki/extensions/Wikibase@master] Refactor ErrorObject HTML extraction

https://gerrit.wikimedia.org/r/1289320

Change #1289320 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Refactor ErrorObject HTML extraction

https://gerrit.wikimedia.org/r/1289320