Skip to main content

ipld_car/error/
not_supported.rs

1use crate::config::DAGLayout;
2#[cfg(feature = "vfs")]
3use crate::error::vfs_err;
4
5use thiserror::Error;
6#[cfg(feature = "vfs")]
7use vfs::error::{VfsError, VfsErrorKind};
8
9#[cfg_attr(feature = "std", derive(Debug))]
10#[derive(Error)]
11pub enum NotSupportedErr {
12	#[error("Path prefix is not supported")]
13	Prefix,
14	#[error("CAR version ({0}) is not supported")]
15	Version(u64),
16	#[error("DAG layout `{0:?}` is not supported")]
17	DAGLayout(DAGLayout),
18}
19
20#[cfg(feature = "vfs")]
21impl From<NotSupportedErr> for VfsError {
22	fn from(c: NotSupportedErr) -> Self {
23		vfs_err(VfsErrorKind::NotSupported, c)
24	}
25}