jam_tooling/
error.rs

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