jam_tooling/
error.rs

1use scale::Error as CodecError;
2
3#[derive(Debug, thiserror::Error)]
4pub enum SegRootError {
5	#[error("No exporting packages reported")]
6	NoExportingPackagesReported,
7	#[error("No block at given slot")]
8	NoBlockAtGivenSlot,
9	#[error("Core not exporting")]
10	CoreNotExporting,
11}
12
13// The composite error type for PolkaJAM tooling.
14#[derive(Debug, thiserror::Error)]
15pub enum Error {
16	#[error("Service not found")]
17	ServiceNotFound,
18	#[error("Bootstrap service not found")]
19	BootstrapServiceNotFound,
20	#[error("Code of the Bootstrap service not found")]
21	BootstrapServiceCodeNotFound,
22	#[error("Bootstrap service has no metadata")]
23	InvalidBootstrapMetadata,
24	#[error("Invalid `Service` type encoding: {0}")]
25	InvalidServiceEncoding(CodecError),
26	#[error("State root not known")]
27	StateRootNotKnown,
28	#[error("BEEFY root not known")]
29	BeefyRootNotKnown,
30	#[error("Unknown command")]
31	UnknownCommand,
32	#[error("Could not parse hash")]
33	CouldNotParseHash,
34	#[error("Could not parse auth queue")]
35	CouldNotParseAuthQueue,
36	#[error("Could not parse pair")]
37	CouldNotParsePair,
38	#[error("Could not parse array")]
39	CouldNotParseArray,
40	#[error("Value too large")]
41	ValueTooLarge,
42	#[error("No pending work item")]
43	NoPendingWorkItem,
44	#[error("No authorization available")]
45	NoAuthorizationAvailable,
46	#[error("Segment root parse error: {0}")]
47	CouldNotParseSegRoot(#[from] SegRootError),
48	#[error("I/O error: {0}")]
49	Io(#[from] std::io::Error),
50	#[error("Integer parse error: {0}")]
51	ParseInt(#[from] std::num::ParseIntError),
52	#[error("Hex parse error: {0}")]
53	HexParse(#[from] hex::FromHexError),
54}