Page MenuHomePhabricator

More robust way of handling errors in Cache.php
Closed, ResolvedPublic

Details

Related Gerrit Patches:
mediawiki/extensions/ORES : masterBetter way to handle errors in Cache.php

Event Timeline

Restricted Application added subscribers: Zppix, Aklapper. · View Herald TranscriptJun 15 2016, 1:00 PM
Ladsgroup added a comment.EditedJun 15 2016, 1:02 PM

From: https://gerrit.wikimedia.org/r/#/c/294398/1/includes/Cache.php

I would suggest a different approach:

  • define a member variable $errorHandler that contains a callback function.
  • per default, this would throw a RuntimeException
  • provide a setter for the callback function
  • for batch mode, set it to a closure that odes nothing, or just logs output

That's clearer and more flexible, and it allows you to use the maintenancescript's output) function to report issues to the user.

Halfak triaged this task as Low priority.Jul 5 2016, 2:18 PM

Change 299743 had a related patch set uploaded (by Ladsgroup):
Better way to handle errors in Cache.php

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

Change 299743 merged by jenkins-bot:
Better way to handle errors in Cache.php

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

Ladsgroup closed this task as Resolved.Jul 26 2016, 3:01 PM