firefly_audio/
error.rs

1use core::fmt;
2
3pub enum NodeError {
4    TooManyChildren,
5    TooManyNodes,
6    UnknownID(u32),
7}
8
9impl fmt::Display for NodeError {
10    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
11        match self {
12            Self::TooManyChildren => write!(f, "the node has too many children"),
13            Self::TooManyNodes => write!(f, "the tree has too many nodes"),
14            Self::UnknownID(id) => write!(f, "there is no node with id {id}"),
15        }
16    }
17}