1use std::error::Error;
2use std::fmt;
3
4#[derive(Clone, Debug, Eq, PartialEq)]
6pub enum CompoundValidationError {
7 EmptyName,
9 EmptyCommonName,
11 EmptySystematicName,
13 EmptyIdentifierNamespace,
15 EmptyIdentifierValue,
17}
18
19impl fmt::Display for CompoundValidationError {
20 fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
21 match self {
22 Self::EmptyName => formatter.write_str("compound name must not be empty"),
23 Self::EmptyCommonName => formatter.write_str("common name must not be empty"),
24 Self::EmptySystematicName => formatter.write_str("systematic name must not be empty"),
25 Self::EmptyIdentifierNamespace => {
26 formatter.write_str("compound identifier namespace must not be empty")
27 },
28 Self::EmptyIdentifierValue => {
29 formatter.write_str("compound identifier value must not be empty")
30 },
31 }
32 }
33}
34
35impl Error for CompoundValidationError {}