MWApiError#

exception wikibaseintegrator.wbi_exceptions.MWApiError(error_dict, response=None)[source]#

Bases: Exception

Base class for MediaWiki API error handling

Parameters:
  • error_dict (dict[str, Any]) – The ‘error’ part of the API response

  • response (dict[str, Any] | None, default: None) – The whole API response, which can contain more than the error (e.g. the results of the values parsed by wbparsevalue)

code: str#
error_dict: dict[str, Any]#
property get_conflicting_entity_ids: list[str]#

Compute the list of conflicting entities from the error messages.

Returns:

A list of conflicting entities or an empty list

property get_languages: list[str]#

Compute a list of language identifiers from the error messages. Indicating the language which triggered the error.

Returns:

A list of language identifiers or an empty list

info: str#
messages: list[dict[str, Any]]#
messages_names: list[str]#
response: dict[str, Any] | None#