use crate::algebra::AlgebraBuildError;
use crate::dynkin::DynkinError;
use crate::enumerate::EnumerateError;
use crate::hom::HomError;
use crate::homspace::HomSpaceError;
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum ArQuiverError {
Hom(HomError),
Space(HomSpaceError),
Injective(AlgebraBuildError),
UnsupportedDomain {
dynkin: DynkinError,
nakayama: EnumerateError,
},
RadicalSquareNotContained {
source: Vec<usize>,
target: Vec<usize>,
},
ResidueDegreeDoesNotDivide {
dim_vector: Vec<usize>,
base_dim: usize,
residue_degree: usize,
},
}
display_error! { error ArQuiverError {
Self::Hom(error) => "morphism rejected: {error}";
Self::Space(error) => "hom space rejected the input: {error}";
Self::Injective(error) => "the opposite algebra could not be built: {error}";
Self::UnsupportedDomain { dynkin, nakayama } => "no complete enumeration applies: the Dynkin route reports {dynkin}, the Nakayama route reports {nakayama}";
Self::RadicalSquareNotContained { source, target } => "the radical square of ({source:?}, {target:?}) left the radical; crate defect";
Self::ResidueDegreeDoesNotDivide { dim_vector, base_dim, residue_degree } => "residue degree {residue_degree} of {dim_vector:?} does not divide the base dimension {base_dim}; crate defect";
} }
from_variants! { ArQuiverError {
HomError => Hom,
HomSpaceError => Space,
} }