-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patherror.rs
More file actions
59 lines (56 loc) · 1.57 KB
/
error.rs
File metadata and controls
59 lines (56 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// SPDX-License-Idnetifier: Apache-2.0
use super::*;
/// Errors created by this library
#[derive(Clone, Debug, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
/// A multicodec decoding error
#[error(transparent)]
Multicodec(#[from] multicodec::Error),
/// A multihash error
#[error(transparent)]
Multihash(#[from] multihash::Error),
/// A mulikey error
#[error(transparent)]
Multikey(#[from] multikey::Error),
/// A multisig error
#[error(transparent)]
Multisig(#[from] multisig::Error),
/// Cid error
#[error(transparent)]
Cid(#[from] CidError),
/// Vlad error
#[error(transparent)]
Vlad(#[from] VladError),
}
/// Cid Errors created by this library
#[derive(Clone, Debug, thiserror::Error)]
#[non_exhaustive]
pub enum CidError {
/// Missing target codec
#[error("Missing target data encoding codec")]
MissingTargetCodec,
/// Missing hash data
#[error("Missing hash data")]
MissingHash,
/// Trying to build a legacy Cid using the wrong function
#[error("Building legacy Cid with the wrong function")]
LegacyCid,
/// Trying to build a modern Cid using the wrong function
#[error("Building modern Cid with the wrong function")]
ModernCid,
}
/// Vlad Errors created by this library
#[derive(Clone, Debug, thiserror::Error)]
#[non_exhaustive]
pub enum VladError {
/// Missing sigil 0x07
#[error("Missing Vlad sigil")]
MissingSigil,
/// Missing nonce
#[error("Missing nonce")]
MissingNonce,
/// Missing nonce
#[error("Missing cid")]
MissingCid,
}