1use pop_common::sourcing::Error as SourcingError;
4use thiserror::Error;
5
6#[derive(Error, Debug)]
8#[allow(clippy::enum_variant_names)]
9pub enum Error {
10 #[error("Anyhow error: {0}")]
12 AnyhowError(#[from] anyhow::Error),
13 #[error("Failed to parse balance: {0}")]
15 BalanceParsing(String),
16 #[error("{0}")]
18 CallContractError(String),
19 #[error("{0}")]
21 CommonError(#[from] pop_common::Error),
22 #[error("Pre-submission dry-run failed: {0}")]
24 DryRunUploadContractError(String),
25 #[error("Pre-submission dry-run failed: {0}")]
27 DryRunCallContractError(String),
28 #[error("Failed to parse hex encoded bytes: {0}")]
30 HexParsing(String),
31 #[error("HTTP error: {0}")]
33 HttpError(#[from] reqwest::Error),
34 #[error("Incorrect number of arguments provided. Expecting {expected}, {provided} provided")]
36 IncorrectArguments {
37 expected: usize,
39 provided: usize,
41 },
42 #[error("Failed to install {0}")]
44 InstallContractsNode(String),
45 #[error("{0}")]
47 InstantiateContractError(String),
48 #[error("Invalid constructor name: {0}")]
50 InvalidConstructorName(String),
51 #[error("Invalid message name: {0}")]
53 InvalidMessageName(String),
54 #[error("Invalid name: {0}")]
56 InvalidName(String),
57 #[error("IO error: {0}")]
59 IO(#[from] std::io::Error),
60 #[error("Failed to get manifest path: {0}")]
62 ManifestPath(String),
63 #[error("Failed to map account: {0}")]
65 MapAccountError(String),
66 #[error("Argument {0} is required")]
68 MissingArgument(String),
69 #[error("Failed to create new contract project: {0}")]
71 NewContract(String),
72 #[error("ParseError error: {0}")]
74 ParseError(#[from] url::ParseError),
75 #[error("The `Repository` property is missing from the template variant")]
77 RepositoryMissing,
78 #[error("Sourcing error {0}")]
80 SourcingError(SourcingError),
81 #[error("Failed to execute test command: {0}")]
83 TestCommand(String),
84 #[error("Unsupported platform: {os}")]
86 UnsupportedPlatform {
87 os: &'static str,
89 },
90 #[error("{0}")]
92 UploadContractError(String),
93}