use std::fmt::Debug;
use crdt_graph::TwoPTwoPGraphError;
use thiserror::Error;
use uuid::Uuid;
#[derive(Error, Debug)]
pub enum CrdfError {
#[error("Graph error: {0}")]
Graph(#[from] TwoPTwoPGraphError<Uuid>),
#[error("Triple not found")]
TripleNotFound,
#[error("Invalid subject: literals cannot be subjects")]
LiteralSubject,
#[error("Invalid predicate: predicates must be IRIs")]
InvalidPredicate,
#[error("Invalid language tag: language tags must not be empty (BCP47)")]
EmptyLanguageTag,
#[error(
"Invalid datatype: rdf:langString requires a language tag; use with_language() instead"
)]
LangStringDatatype,
#[error("oxrdf conversion error: {0}")]
OxrdfConversion(String),
#[error("I/O error: {0}")]
Io(#[from] std::io::Error),
#[error("FlatBuffers decode error: {0}")]
FlatBuffersDecode(#[from] crdt_graph::flatbuffers::DecodeError),
}