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("precondition failed")]
21 PreconditionFailed,
22 #[error("Performs dynamic cast failed.")]
23 CastError,
24 #[error("Error occurs in wasm: {message}")]
25 Wasm { message: String },
26 #[error(transparent)]
27 Other(BoxedError),
28}