use thiserror::Error;
use crate::constants::PDU_HEADER_LEN_BYTES;
#[derive(Debug, PartialEq, Eq, Error)]
pub enum DisError {
#[error("{0}")]
ParseError(String), #[error("The buffer does not contain enough bytes for a valid DIS header. {0} bytes available, needed {PDU_HEADER_LEN_BYTES}")]
InsufficientHeaderLength(u16), #[error("PDU has insufficient length. Expected {0}, found {1}")]
InsufficientPduLength(u16, u16), #[error("PDU is larger than size of the buffer for serialisation. Needs {0} bytes, available {1} bytes")]
InsufficientBufferSize(u16, usize), #[error("Provided String is not valid ASCII encoded.")]
StringNotAsciiError, #[error("Provided String is too long.")]
StringTooLongError, #[error("IFF PDU - Incorrect System Time provided.")]
IffIncorrectSystemType, #[error("IFF PDU - Undetermined System Time.")]
IffUndeterminedSystemType, }