-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
32 changed files
with
2,248 additions
and
437 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,27 @@ | ||
use std::{fmt, result}; | ||
use std::fmt::Error as FmtError; | ||
use std::result::Result as StdResult; | ||
|
||
use serde_json::Error as JsonError; | ||
use thiserror::Error; | ||
|
||
use crate::http::HttpError; | ||
|
||
/// The common result type returned by library functions. | ||
pub type Result<T> = result::Result<T, Error>; | ||
pub type Result<T> = StdResult<T, Error>; | ||
|
||
/// The common error enum returned by library functions within a [`Result`]. | ||
/// | ||
/// [`Result`]: type.Result.html | ||
#[derive(Debug, Error)] | ||
#[non_exhaustive] | ||
pub enum Error { | ||
/// An error while formatting a message. | ||
#[error(transparent)] | ||
Format(#[from] fmt::Error), | ||
Format(#[from] FmtError), | ||
/// An HTTP error. | ||
#[error(transparent)] | ||
HttpError(#[from] HttpError), | ||
/// A JSON error. | ||
#[error(transparent)] | ||
JsonError(#[from] serde_json::Error), | ||
JsonError(#[from] JsonError), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.