use alloc::string::String;
use thiserror::Error;
use crate::errors::TransformError;
#[derive(Error, Debug)]
#[non_exhaustive]
pub enum BufferError {
#[error("the buffer holds no transforms")]
NoTransformAvailable,
#[error("cannot mix static and dynamic transforms for the same child frame")]
StaticDynamicConflict,
#[error("a frame cannot be its own parent")]
SelfReferentialFrame,
#[error("re-parenting is not supported (the child frame's parent is {0})")]
ReparentingNotSupported(String),
#[error("the buffer already stores a different child frame ({0})")]
ChildFrameMismatch(String),
#[error("inserting the transform would create a cycle in the frame tree")]
CycleDetected,
#[error("transform error: {0}")]
TransformError(#[from] TransformError),
}