Skip to main content

optirs_tpu/
error.rs

1// Error handling for OptiRS TPU module
2//
3// This module re-exports error types from scirs2_core to maintain
4// SciRS2 integration policy compliance.
5
6// Re-export from scirs2-core for SciRS2 compliance
7pub use scirs2_core::error::{CoreError as OptimError, CoreResult as Result};
8
9// TPU-specific error types
10#[derive(Debug, thiserror::Error)]
11pub enum TpuError {
12    #[error("TPU coordination error: {0}")]
13    Coordination(String),
14
15    #[error("XLA compilation error: {0}")]
16    XlaCompilation(String),
17
18    #[error("Pod synchronization error: {0}")]
19    PodSynchronization(String),
20
21    #[error("Core error: {0}")]
22    Core(#[from] OptimError),
23}
24
25pub type TpuResult<T> = std::result::Result<T, TpuError>;