Page MenuHomePhabricator

πŸ‹ Handle exceptions that can occur while saving the lexeme
Closed, ResolvedPublic

Description

  • Resource too large
  • Edit prevented (abusefilter etc)
  • Rate limiting
  • Temp account creation limits
  • ...?

It might make sense to split this into multiple sub tasks.

Event Timeline

Change #1329584 had a related patch set uploaded (by Silvan Heintze; author: Silvan Heintze):

[mediawiki/extensions/WikibaseLexeme@master] REST: Introduce UpdateExceptionHandler

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

Change #1329584 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexeme@master] REST: Introduce UpdateExceptionHandler

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

Change #1333879 had a related patch set uploaded (by Silvan Heintze; author: Silvan Heintze):

[mediawiki/extensions/WikibaseLexeme@master] REST: Add unit tests for EntityUpdater exceptions

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

Change #1333879 merged by jenkins-bot:

[mediawiki/extensions/WikibaseLexeme@master] REST: Add unit tests for EntityUpdater exceptions

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

The case of EntityUpdateFailed (see T436121) reveils some ongoing confusion about our way of handling exceptions and declaring them via @throws annotation.

Some examples from the EntityUpdater:

  • StorageException is a RuntimeException that is being handled in some cases and re-thrown as "unexpected" in others, but not declared
  • EntityUpdateFailed is declared via @throws but treated as β€œunexpected” - it could be a RuntimeException instead and not be declared
  • ReadOnlyError is not a RuntimeException but neither declared nor handled (effectively also treated as β€œunexpected”), causing IDE complaints

Maybe this should be reflected in ADR 11 by enhancing the part that says "unless they are not expected to be caught" with examples that are not handled by application code and eventually caught by the UnexpectedErrorHandlerMiddleware

Change #1338776 had a related patch set uploaded (by Silvan Heintze; author: Silvan Heintze):

[mediawiki/extensions/Wikibase@master] REST: Update ADR 11

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

Change #1338776 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] REST: Update ADR 11

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