14 releases

0.3.0-alpha.2 Feb 1, 2023
0.3.0-alpha.1 Jan 31, 2023
0.2.2 Oct 1, 2022
0.2.1 Sep 19, 2022
0.1.1 Oct 19, 2021

#1595 in Web programming

Download history 1/week @ 2024-02-08 27/week @ 2024-02-15 5/week @ 2024-02-22 5/week @ 2024-02-29 61/week @ 2024-03-28 31/week @ 2024-04-04

61 downloads per month

GPL-3.0-or-later

47KB
878 lines

MediaWiki API error types

The MediaWIki API is rather dynamic and has quite a few possible errors that you can run into. This crate aims to have dedicated types for each possible case as well as a conversion map between the API's error codes and Rust types.

The ApiError type is serde-deserializable, and can be converted into a specific Error type using the API response code. Aside from serde, the library is fully library independent and should be usable by any MediaWiki library or framework.

Features

The from-* features can be enabled to add some dependencies that are used to implement the From trait. Each dependency can be individually toggled with a feature named from-{dependency}. Current features are:

  • from-mwtitle
  • from-reqwest
  • from-tokio

Contributing

mwapi_errors is a part of the mwbot-rs project. We're always looking for new contributors, please reach out if you're interested!

Dependencies

~0.7–16MB
~175K SLoC