HomePhabricator

Use Status for error handling

Description

Use Status for error handling

Introduce messages for possible error conditions, and make
SuggesterParamsParser and SuggestionGenerator return Status objects
which can contain those messages, instead of throwing exceptions that
show up directly in the API output.

Also, move the error handling for unresolved redirects into
SuggestionGenerator, and handle it the same way as everything else,
instead of using WikibaseRepo’s ApiErrorReporter.

The one PropertySuggester-specific error message is added to i18n/api/
because we don’t expect it to be used in normal operations, and so it’s
low priority to translate. Other messages are taken from WikibaseRepo.

Bug: T229319
Bug: T251876
Change-Id: Icd1633c5e5284c3db9420093ab3b7ceb635f2289

Details

Provenance
Lucas_Werkmeister_WMDEAuthored on Jul 8 2021, 1:37 PM
Parents
rEPS9bece3ebc780: Declare `continue` as integer parameter
Branches
Unknown
Tags
Unknown
ChangeId
Icd1633c5e5284c3db9420093ab3b7ceb635f2289