Skip to content

Commit d7cd704

Browse files
committed
feat(lib)!: add Error::SerdeJson variant
1 parent d6a07af commit d7cd704

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,12 @@ impl Builder {
204204
pub enum Error {
205205
/// Error during `minreq` HTTP request
206206
#[cfg(feature = "blocking")]
207-
Minreq(::minreq::Error),
208-
/// Error during reqwest HTTP request
207+
Minreq(minreq::Error),
208+
/// Error during `reqwest` HTTP request
209209
#[cfg(feature = "async")]
210-
Reqwest(::reqwest::Error),
210+
Reqwest(reqwest::Error),
211+
/// Error during JSON (de)serialization
212+
SerdeJson(serde_json::Error),
211213
/// HTTP response error
212214
HttpResponse {
213215
/// The HTTP status code returned by the server.
@@ -263,6 +265,7 @@ impl std::error::Error for Error {}
263265
impl_error!(::minreq::Error, Minreq, Error);
264266
#[cfg(feature = "async")]
265267
impl_error!(::reqwest::Error, Reqwest, Error);
268+
impl_error!(serde_json::Error, SerdeJson, Error);
266269
impl_error!(std::num::ParseIntError, Parsing, Error);
267270
impl_error!(bitcoin::consensus::encode::Error, BitcoinEncoding, Error);
268271
impl_error!(bitcoin::hex::HexToArrayError, HexToArray, Error);

0 commit comments

Comments
 (0)