[DEV-7133] Add AsgError::Cycle
We want a special error type when we detect cyclic dependencies.master
parent
7a4f6cf9f2
commit
59f194a46a
|
@ -238,6 +238,8 @@ pub enum AsgError {
|
|||
|
||||
/// The node was not expected in the current context
|
||||
UnexpectedNode(String),
|
||||
/// The graph has a cyclic dependency
|
||||
Cycle(String),
|
||||
}
|
||||
|
||||
impl std::fmt::Display for AsgError {
|
||||
|
@ -252,6 +254,9 @@ impl std::fmt::Display for AsgError {
|
|||
Self::UnexpectedNode(msg) => {
|
||||
write!(fmt, "unexpected node: {}", msg)
|
||||
}
|
||||
Self::Cycle(msg) => {
|
||||
write!(fmt, "Cyclic dependency detected: {}", msg)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue