use thiserror::Error;
#[derive(Error, Debug)]
#[allow(dead_code)] pub enum ValidationError {
#[error("Failed to parse DIDComm message: {0}")]
MessageParseError(String),
#[error("Failed to parse datetime string '{value}': {message}")]
DateTimeParseError { value: String, message: String },
#[error("Invalid message body: {0}")]
InvalidBody(String),
#[error("Invalid message structure: {0}")]
StructureError(String),
#[error("Missing required field: {0}")]
MissingFieldError(String),
#[error("Attachment validation failed: {0}")]
AttachmentError(String),
#[error("Validation error: {0}")]
Other(String),
}
#[allow(dead_code)] pub fn to_validation_error<S: AsRef<str>>(error: S) -> ValidationError {
ValidationError::Other(error.as_ref().to_string())
}