Skip to content

Support new error format #34

@lucaswerkmeister

Description

@lucaswerkmeister

Since MediaWiki 1.29, the API can return errors in a new format (documentation): if the global errorformat parameter is set to anything other than bc (the default, for backwards compatibility), then instead of a single error object, the response can contain an errors list of error objects. Since mwapi currently only checks if the response contains an error, if the user specifies a different error format then mwapi will not recognize the error(s) and instead return the result as a regular response.

I’m not sure what mwapi should do in this case, though. Throw an APIError for the first error and ignore the rest? Define a new exception class for a list of APIErrors (which should probably derive from APIError so it can still be caught like one)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions