Page MenuHomePhabricator

Format errors consistently in claim html
Closed, ResolvedPublic

Description

We had uncaught exceptions on pages with invalid properties (see bug 61913). We hotfixed that in the branch.

That particular case was due to importing an item, which we really don't support, but may occur in other situations. If it occurs, then the entire item does not render.

The code in master is quite ugly for how it handles displaying errors to the user and is totally inconsistent from the JS UI.

To do a proper fix in master, a bit more cleanup of this code is needed.

(side effect is maybe we can get rid of some of the error formatting code in JS and just use what php generates)


Version: master
Severity: normal
Whiteboard: u=dev c=backend p=13 s=2014-05-20

Details

Reference
bz62495

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 2:58 AM
bzimport set Reference to bz62495.
bzimport added a subscriber: Unknown Object (MLST).

pages with invalid properties

Define "invalid properties"

@jeroen e.g. a mismatch of commons media data type (value) with a wikibase entity id property

which apparently can happen per bug 62425 (and perhaps other ways)

Change 120530 had a related patch set uploaded by Tobias Gritschacher:
Handle InvalidArgumentException in ClaimHtmlGenerator

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

Change 120530 merged by jenkins-bot:
Handle InvalidArgumentException in ClaimHtmlGenerator

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

Change 121678 had a related patch set uploaded by Aude:
Use DataValueMismatchException for Snak formatting [WIP]

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

needs to use mismatch exception consistently in more of the formatters (in data values and to-be-created EntityIdValue formatters)

also needs handling in diff formatting.

Change 121678 abandoned by Aude:
Use MismatchingDataValueTypeException for Snak formatting

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

remaining issues are that data type mismatch and undeserializable value errors are formatted inconsistently vs. how they are done in the js code, and don't have any css to indicate they are errors.