hpt_common/error/common.rs
1use std::panic::Location;
2
3use thiserror::Error;
4
5/// Errors that can occur during kernel operations (compilation, execution)
6#[derive(Debug, Error)]
7pub enum CommonError {
8 /// Error that occurs when lock failed
9 #[error("Lock failed: {message} at {location}")]
10 LockFailed {
11 /// Message describing the lock failure
12 message: String,
13 /// Location where the error occurred
14 location: &'static Location<'static>,
15 },
16
17 /// Error that occurs when trying to forget a tensor that is still in use
18 #[error("Cannot forget tensor: {msg}")]
19 CantForgetTensor {
20 /// Message describing the error
21 msg: String,
22 /// Location where the error occurred
23 location: &'static Location<'static>,
24 },
25}