mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-27 00:31:02 +00:00
error codes for schema
This commit is contained in:
@ -26,7 +26,12 @@ impl error::Error for Error {}
|
||||
|
||||
impl ErrorCode for Error {
|
||||
fn error_code(&self) -> Code {
|
||||
// TODO populate with correct error codes
|
||||
Code::Internal
|
||||
use Error::*;
|
||||
|
||||
match self {
|
||||
FieldNameNotFound(_) => Code::Internal,
|
||||
MaxFieldsLimitExceeded => Code::MaxFieldsLimitExceeded,
|
||||
PrimaryKeyAlreadyPresent => Code::PrimaryKeyAlreadyPresent,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user