mirror of
https://github.com/MercuryWorkshop/epoxy-tls.git
synced 2025-05-13 06:20:02 -04:00
expose close reasons
This commit is contained in:
parent
8cbab94955
commit
569789c2a0
9 changed files with 294 additions and 74 deletions
|
@ -30,6 +30,7 @@ use wasm_streams::ReadableStream;
|
|||
use web_sys::ResponseInit;
|
||||
#[cfg(feature = "full")]
|
||||
use websocket::EpoxyWebSocket;
|
||||
use wisp_mux::CloseReason;
|
||||
#[cfg(feature = "full")]
|
||||
use wisp_mux::StreamType;
|
||||
|
||||
|
@ -50,6 +51,8 @@ pub enum EpoxyError {
|
|||
InvalidDnsName(#[from] futures_rustls::rustls::pki_types::InvalidDnsNameError),
|
||||
#[error("Wisp: {0:?} ({0})")]
|
||||
Wisp(#[from] wisp_mux::WispError),
|
||||
#[error("Wisp server closed: {0}")]
|
||||
WispCloseReason(wisp_mux::CloseReason),
|
||||
#[error("IO: {0:?} ({0})")]
|
||||
Io(#[from] std::io::Error),
|
||||
#[error("HTTP: {0:?} ({0})")]
|
||||
|
@ -61,9 +64,6 @@ pub enum EpoxyError {
|
|||
#[error("HTTP ToStr: {0:?} ({0})")]
|
||||
ToStr(#[from] http::header::ToStrError),
|
||||
#[cfg(feature = "full")]
|
||||
#[error("Getrandom: {0:?} ({0})")]
|
||||
GetRandom(#[from] getrandom::Error),
|
||||
#[cfg(feature = "full")]
|
||||
#[error("Fastwebsockets: {0:?} ({0})")]
|
||||
FastWebSockets(#[from] fastwebsockets::WebSocketError),
|
||||
|
||||
|
@ -135,6 +135,12 @@ impl From<InvalidMethod> for EpoxyError {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<CloseReason> for EpoxyError {
|
||||
fn from(value: CloseReason) -> Self {
|
||||
EpoxyError::WispCloseReason(value)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
enum EpoxyResponse {
|
||||
Success(Response<Incoming>),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue