#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
#[non_exhaustive]
pub enum FitsError {
#[error("keyword '{keyword}' occurs {count} times; select an occurrence")]
AmbiguousKeyword {
keyword: String,
count: usize,
},
#[error("keyword '{keyword}' exceeds 8 characters")]
KeywordTooLong {
keyword: String,
},
#[error("keyword '{keyword}' contains characters outside A-Z 0-9 - _")]
InvalidKeyword {
keyword: String,
},
#[error("keyword '{keyword}' has no occurrence {occurrence} (found {count})")]
OccurrenceOutOfRange {
keyword: String,
occurrence: usize,
count: usize,
},
#[error("declared data size of {declared} bytes exceeds the to_bytes zero-fill cap ({max})")]
DataTooLarge {
declared: u64,
max: u64,
},
}