fusio_core/
error.rs

1use alloc::{boxed::Box, string::String};
2use core::fmt::Debug;
3
4use thiserror::Error;
5
6pub type BoxedError = Box<dyn core::error::Error + Send + Sync + 'static>;
7
8#[derive(Debug, Error)]
9#[error(transparent)]
10#[non_exhaustive]
11pub enum Error {
12    #[cfg(feature = "std")]
13    Io(#[from] std::io::Error),
14    #[error(transparent)]
15    Path(BoxedError),
16    #[error(transparent)]
17    Remote(BoxedError),
18    #[error("unsupported operation: {message}")]
19    Unsupported { message: String },
20    #[error("Performs dynamic cast failed.")]
21    CastError,
22    #[error("Error occurs in wasm: {message}")]
23    Wasm { message: String },
24    #[error(transparent)]
25    Other(BoxedError),
26}