use crate::node::NodeId;

/// Errors that can occur in the inspector system.
#[derive(Debug, thiserror::Error)]
pub enum InspectorError {
    #[error("node not found: {0}")]
    NodeNotFound(NodeId),

    #[error("node already exists: {0}")]
    NodeAlreadyExists(NodeId),

    #[error("parent node not found: {0}")]
    ParentNotFound(NodeId),

    #[error("cannot remove root node")]
    CannotRemoveRoot,

    #[error("channel closed")]
    ChannelClosed,

    #[error("channel full")]
    ChannelFull,

    #[error("command timed out")]
    CommandTimeout,

    #[error("process not found: pid {0}")]
    ProcessNotFound(u32),

    #[error("{0}")]
    Internal(String),
}

pub type Result<T> = std::result::Result<T, InspectorError>;
