error.rs
1 // Copyright (c) 2025 ADnet Contributors 2 // SPDX-License-Identifier: Apache-2.0 3 4 //! Node error types 5 6 use thiserror::Error; 7 8 #[derive(Debug, Error)] 9 pub enum NodeError { 10 #[error("Failed to start node: {0}")] 11 StartupFailed(String), 12 13 #[error("Startup error: {0}")] 14 StartupError(String), 15 16 #[error("Failed to stop node: {0}")] 17 ShutdownFailed(String), 18 19 #[error("Configuration error: {0}")] 20 ConfigError(String), 21 22 #[error("Storage error: {0}")] 23 StorageError(String), 24 25 #[error("Network error: {0}")] 26 NetworkError(String), 27 28 #[error("Consensus error: {0}")] 29 ConsensusError(String), 30 31 #[error("IO error: {0}")] 32 IoError(#[from] std::io::Error), 33 }