use alloc::string::{String, ToString};
#[cfg(feature = "std")]
use thiserror::Error;
#[derive(Debug)]
#[cfg_attr(feature = "thiserror", derive(Error))]
pub enum StreamError {
#[cfg_attr(feature = "thiserror", error("abort: {0}"))]
Abort(String),
#[cfg_attr(feature = "thiserror", error("abort: {0}"))]
Unknwon(String),
}
impl StreamError {
pub fn abort(message: impl ToString) -> Self {
Self::Abort(message.to_string())
}
pub fn unknown(message: impl ToString) -> Self {
Self::Unknwon(message.to_string())
}
}