Files
rustytorch/crates/specialized/rtx-neuro-gnn/src/error.rs
T
2026-03-04 00:08:42 +00:00

53 lines
1.3 KiB
Rust

//! Error types for brain GNN operations.
use thiserror::Error;
/// Brain GNN error types
#[derive(Debug, Error)]
pub enum GnnError {
/// Invalid graph structure
#[error("Invalid graph: {0}")]
InvalidGraph(String),
/// Dimension mismatch
#[error("Dimension mismatch: {0}")]
DimensionMismatch(String),
/// Invalid configuration
#[error("Invalid configuration: {0}")]
InvalidConfig(String),
/// Model not initialized
#[error("Model not initialized: {0}")]
NotInitialized(String),
/// Training error
#[error("Training error: {0}")]
TrainingError(String),
/// Feature extraction error
#[error("Feature extraction error: {0}")]
FeatureError(String),
/// Connectivity error from upstream
#[error("Connectivity error: {0}")]
ConnectivityError(#[from] rtx_neuro_connectivity::ConnectivityError),
/// Geometry/GNN error from rtx-geom
#[error("Geometry error: {0}")]
GeomError(String),
/// Tensor error
#[error("Tensor error: {0}")]
TensorError(String),
}
/// Result type for brain GNN operations
pub type GnnResult<T> = Result<T, GnnError>;
impl From<rtx_geom::GeomError> for GnnError {
fn from(e: rtx_geom::GeomError) -> Self {
GnnError::GeomError(e.to_string())
}
}