use thiserror::Error;
#[allow(missing_copy_implementations)]
#[derive(Error, Debug)]
pub enum OperationError {
#[error("operation fields can not be empty")]
EmptyFields,
#[error("DELETE operation must not have fields")]
DeleteWithFields,
#[error("previous_operations field can not be empty")]
EmptyPreviousOperations,
#[error("previous_operations field should be empty")]
ExistingPreviousOperations,
#[error(transparent)]
HashError(#[from] crate::hash::HashError),
}
#[derive(Error, Debug)]
#[allow(missing_copy_implementations)]
pub enum OperationFieldsError {
#[error("field already exists")]
FieldDuplicate,
#[error("field does not exist")]
UnknownField,
}
#[derive(Error, Debug)]
#[allow(missing_copy_implementations)]
pub enum OperationEncodedError {
#[error("invalid hex encoding in operation")]
InvalidHexEncoding,
}
#[derive(Error, Debug)]
pub enum VerifiedOperationError {
#[error(transparent)]
EntrySignedError(#[from] crate::entry::EntrySignedError),
#[error(transparent)]
OperationEncodedError(#[from] OperationEncodedError),
#[error(transparent)]
OperationError(#[from] OperationError),
#[error(transparent)]
AuthorError(#[from] crate::identity::AuthorError),
#[error(transparent)]
HashError(#[from] crate::hash::HashError),
}