Wikibase API modules currently often provide a localized error info when calling ApiBase::dieUsage. This is inconsistent with current practice in core, and insufficient for providing localized errors in the UI.
Instead, we should use a new call like dieUsageWithMessage, providing an error code an a Message objects (or message key and parameters). An unlocalized error info may be added, but seems redundant.
This should work similarly to the error reports generated from Status objects, as introduced by I4094feee as a solution to bug 45099.
Note that ApiBase::dieUsageMsg() is similar, but insufficient (as it doesn't provide message keys and parameters to the caller). Also, it requires us to define a mapping between error codes and messages, which is painful to maintain, and non-obvious to use.
Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=45099
https://bugzilla.wikimedia.org/show_bug.cgi?id=45843
https://bugzilla.wikimedia.org/show_bug.cgi?id=35074