#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error(transparent)]
BadUrl(#[from] url::ParseError),
#[error(transparent)]
Deserialize(#[from] serde_json::Error),
#[error(transparent)]
Frame(#[from] crate::frame::Error),
#[error(transparent)]
IoFailure(#[from] std::io::Error),
#[error("unsupported DERP protocol version {0}, only supported version is {1}")]
UnsupportedProtocolVersion(usize, usize),
#[error("received unexpected DERP frame type '{0}'")]
UnexpectedRecvFrameType(crate::frame::FrameType),
#[error("http error")]
Http,
}
impl From<ts_http_util::Error> for Error {
fn from(_: ts_http_util::Error) -> Self {
Error::Http
}
}