use std::sync::PoisonError;
use thiserror::Error;
use crate::{
utils::{ArcLock, ErroredRead, ErroredWrite},
Joint, Link,
};
#[derive(Debug, Error)]
pub enum RebuildBranchError {
#[error(transparent)]
ReadChildJoint(#[from] PoisonError<ErroredRead<ArcLock<Joint>>>),
#[error(transparent)]
ReadChildLink(#[from] PoisonError<ErroredRead<ArcLock<Link>>>),
}
#[derive(Debug, Error)]
pub enum YankLinkError {
#[error(transparent)]
RebuildBranch(#[from] RebuildBranchError),
#[error(transparent)]
ReadParentJoint(#[from] PoisonError<ErroredRead<ArcLock<Joint>>>),
#[error(transparent)]
WriteGrandParentLink(#[from] PoisonError<ErroredWrite<ArcLock<Link>>>),
}
#[derive(Debug, Error)]
pub enum YankJointError {
#[error(transparent)]
RebuildBranch(#[from] RebuildBranchError),
#[error(transparent)]
WriteParentLink(#[from] PoisonError<ErroredWrite<ArcLock<Link>>>),
#[error(transparent)]
ReadYankedJoint(#[from] PoisonError<ErroredRead<ArcLock<Joint>>>),
}