Fix PR comments

This commit is contained in:
many 2021-10-28 15:42:42 +02:00
parent 59636fa688
commit cbaca2b579
No known key found for this signature in database
GPG key ID: 2CEF23B75189EACA
4 changed files with 5 additions and 5 deletions

View file

@ -22,7 +22,7 @@ pub enum IndexResolverError {
#[error("Internal Error: `{0}`")]
Internal(Box<dyn std::error::Error + Send + Sync + 'static>),
#[error("Internal Error: Index uuid `{0}` is already assigned.")]
UUIdAlreadyExists(Uuid),
UuidAlreadyExists(Uuid),
#[error("{0}")]
Milli(#[from] milli::Error),
#[error("`{0}` is not a valid index uid. Index uid can be an integer or a string containing only alphanumeric characters, hyphens (-) and underscores (_).")]
@ -60,7 +60,7 @@ impl ErrorCode for IndexResolverError {
IndexResolverError::UnexistingIndex(_) => Code::IndexNotFound,
IndexResolverError::ExistingPrimaryKey => Code::PrimaryKeyAlreadyPresent,
IndexResolverError::Internal(_) => Code::Internal,
IndexResolverError::UUIdAlreadyExists(_) => Code::Internal,
IndexResolverError::UuidAlreadyExists(_) => Code::Internal,
IndexResolverError::Milli(e) => MilliError(e).error_code(),
IndexResolverError::BadlyFormatted(_) => Code::InvalidIndexUid,
}

View file

@ -64,7 +64,7 @@ impl IndexStore for MapIndexStore {
}
let path = self.path.join(format!("{}", uuid));
if path.exists() {
return Err(IndexResolverError::UUIdAlreadyExists(uuid));
return Err(IndexResolverError::UuidAlreadyExists(uuid));
}
let index_size = self.index_size;