kaspa_consensus_core/errors/
config.rs

1use thiserror::Error;
2
3#[derive(Error, Debug, Clone)]
4pub enum ConfigError {
5    #[error("Configuration: --addpeer and --connect cannot be used together")]
6    MixedConnectAndAddPeers,
7
8    #[error("Configuration: --logdir and --nologfiles cannot be used together")]
9    MixedLogDirAndNoLogFiles,
10
11    #[error("Configuration: --ram-scale cannot be set below 0.1")]
12    RamScaleTooLow,
13
14    #[error("Configuration: --ram-scale cannot be set above 10.0")]
15    RamScaleTooHigh,
16
17    #[error("Configuration: --max-tracked-addresses cannot be set above {0}")]
18    MaxTrackedAddressesTooHigh(usize),
19
20    #[cfg(feature = "devnet-prealloc")]
21    #[error("Cannot preallocate UTXOs on any network except devnet")]
22    PreallocUtxosOnNonDevnet,
23
24    #[cfg(feature = "devnet-prealloc")]
25    #[error("--num-prealloc-utxos has to appear with --prealloc-address and vice versa")]
26    MissingPreallocNumOrAddress,
27}
28
29pub type ConfigResult<T> = std::result::Result<T, ConfigError>;