use data::LinkReference;
#[derive(Debug, thiserror::Error)]
pub enum SequenceError<T: LinkReference> {
#[error(transparent)]
Store(#[from] crate::Error<T>),
#[error("raw number magnitude {0} exceeds MAX / 2")]
RawNumberOutOfRange(T),
#[error("Unicode conversion requires an external reference range for code units")]
ExternalReferencesDisabled,
#[error("payload {0} cannot be represented as a UTF-16 code unit")]
CodeUnitOutOfRange(T),
#[error("UTF-16 code unit {0} does not fit the address type")]
CodeUnitDoesNotFit(u16),
#[error("link {0} is not a Unicode symbol")]
NotUnicodeSymbol(T),
#[error("link {0} is not a Unicode sequence")]
NotUnicodeSequence(T),
#[error("cycle at sequence link {0}")]
CyclicSequence(T),
#[error(transparent)]
InvalidUtf16(#[from] std::string::FromUtf16Error),
}