1use std::{error, fmt, num::TryFromIntError};
4use adic::AdicError;
5
6#[derive(Debug, Clone, PartialEq, Eq, Hash)]
7pub enum AdicShapeError {
9 AdicError(AdicError),
11 PetGraph,
13 ImproperConfig(String),
15 InfiniteDigits,
17 StyleError(String),
19 TryFromIntError,
21}
22
23
24impl fmt::Display for AdicShapeError {
25 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
26 write!(f, "{self:?}")
27 }
28}
29
30impl error::Error for AdicShapeError { }
31
32
33impl From<AdicError> for AdicShapeError {
34 fn from(e: AdicError) -> Self {
35 AdicShapeError::AdicError(e)
36 }
37}
38
39impl From<TryFromIntError> for AdicShapeError {
40 fn from(_: TryFromIntError) -> Self {
41 AdicShapeError::TryFromIntError
42 }
43}