Page MenuHomePhabricator

Rewrite LogicException in Cite using safer alternatives
Open, Needs TriagePublic1 Estimated Story Points

Description

Possibly user-facing throw new LogicException, if there are any (CodeSearch), should be rewritten to:

  • Log at error or warning level, making sure this will be tagged with the extension name.
  • Safely escape from the unknown state. Degrade the output if necessary (for a dramatic example, don't process any remaining references) but without the fatal exception. Another possibility is to throw a recoverable exception and catch it elsewhere.

Event Timeline

Change 567971 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/Cite@master] Remove one unnecessary LogicException from ReferenceStack

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

Change 567971 merged by jenkins-bot:
[mediawiki/extensions/Cite@master] Remove one unnecessary LogicException from ReferenceStack

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

This might already be resolved. As of now, there are 6 LogicExceptions in 2 files in the Cite extension left. As far as I can tell they are all fine, i.e. they can not be triggered by user input, but only when a dev does make a mistake. To do: Check if this impression is correct. Possibly remove some of the LogicExceptions that aren't needed any more.

Krinkle renamed this task from Rewrite LogicException using safer alternatives to Rewrite LogicException in Cite using safer alternatives.Oct 4 2021, 11:03 PM