use std::{io, string};
use thiserror::Error;
#[derive(Debug, Error)]
pub enum Amf0DeserializationError {
#[error("Encountered unknown marker: {marker}")]
UnknownMarker { marker: u8 },
#[error("Unexpected empty object property name")]
UnexpectedEmptyObjectPropertyName,
#[error("Hit end of the byte buffer but was expecting more data")]
UnexpectedEof,
#[error("Failed to read byte buffer: {0}")]
BufferReadError(#[from] io::Error),
#[error("Failed to read a utf8 string from the byte buffer: {0}")]
StringParseError(#[from] string::FromUtf8Error),
}
#[derive(Debug, Error)]
pub enum Amf0SerializationError {
#[error("String length greater than 65,535")]
NormalStringTooLong,
#[error("Failed to write to byte buffer")]
BufferWriteError(#[from] io::Error),
}