decompose error messages

This commit is contained in:
marin postma 2021-06-24 10:53:51 +02:00
parent a2368db154
commit a1d34faaad
No known key found for this signature in database
GPG key ID: 6088B7721C3E39F9
7 changed files with 32 additions and 32 deletions

View file

@ -4,13 +4,13 @@ pub type Result<T> = std::result::Result<T, UuidResolverError>;
#[derive(Debug, thiserror::Error)]
pub enum UuidResolverError {
#[error("name already exist.")]
#[error("Index already exists.")]
NameAlreadyExist,
#[error("index \"{0}\" doesn't exist.")]
#[error("Index \"{0}\" not found.")]
UnexistingIndex(String),
#[error("badly formatted index uid: {0}")]
#[error("Index must have a valid uid; Index uid can be of type integer or string only composed of alphanumeric characters, hyphens (-) and underscores (_).")]
BadlyFormatted(String),
#[error("internal error resolving index uid: {0}")]
#[error("Internal error: {0}")]
Internal(Box<dyn std::error::Error + Sync + Send + 'static>),
}