mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
error codes for schema
This commit is contained in:
parent
9c58ca7ce5
commit
e2546f2646
2 changed files with 10 additions and 3 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue