Skip to content

Commit

Permalink
Merge pull request #32 from druskus20/public-errors
Browse files Browse the repository at this point in the history
fix: #25. Expose errors as public
  • Loading branch information
emreyalvac authored Jun 13, 2024
2 parents af943fa + 7eb97ba commit 43295f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,15 @@ impl Display for RequestError {

#[derive(Debug)]
pub enum ServerEventError {
_ConnectionError,
ConnectionError,
}

impl Error for ServerEventError {}

impl Display for ServerEventError {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
ServerEventError::_ConnectionError => write!(f, "Connection error for server events"),
ServerEventError::ConnectionError => write!(f, "Connection error for server events"),
}
}
}
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use constants::{Method, Response, AUTH};
use errors::{RequestError, RequestResult, UrlParseError, UrlParseResult};
use errors::{RequestResult, UrlParseResult};
use params::Params;
use reqwest::StatusCode;
use serde::de::DeserializeOwned;
Expand All @@ -11,6 +11,8 @@ use utils::check_uri;

use crate::sse::ServerEvents;

pub use errors::{RequestError, ServerEventError, UrlParseError};

mod constants;
mod errors;
mod params;
Expand Down

0 comments on commit 43295f6

Please sign in to comment.