pub type Result<T> = core::result::Result<T, Error>;
#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
#[non_exhaustive]
pub enum Error {
#[error(transparent)]
BufferTooShort(#[from] broadcast_common::error::BufferTooShort),
#[error(transparent)]
OutputBufferTooSmall(#[from] broadcast_common::error::OutputBufferTooSmall),
#[error("not an emsg box: type {found:?}")]
NotEmsg {
found: [u8; 4],
},
#[error("invalid emsg box size {size}: {reason}")]
InvalidSize {
size: u32,
reason: &'static str,
},
#[error(transparent)]
UnsupportedVersion(#[from] broadcast_common::error::UnsupportedVersion),
#[error("invalid {field} string: {reason}")]
InvalidString {
field: &'static str,
reason: &'static str,
},
#[error(transparent)]
FieldOverflow(#[from] broadcast_common::error::FieldOverflow),
}