mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
invalid content type error
This commit is contained in:
parent
ddd40d87a7
commit
18cb514073
4 changed files with 41 additions and 140 deletions
|
@ -13,12 +13,15 @@ use serde::{Deserialize, Serialize};
|
|||
pub enum MeilisearchHttpError {
|
||||
#[error("A Content-Type header is missing. Accepted values for the Content-Type header are: \"application/json\", \"application/x-ndjson\", \"test/csv\"")]
|
||||
MissingContentType,
|
||||
#[error("The Content-Type \"{0}\" is invalid. Accepted values for the Content-Type header are: \"application/json\", \"application/x-ndjson\", \"test/csv\"")]
|
||||
InvalidContentType(String),
|
||||
}
|
||||
|
||||
impl ErrorCode for MeilisearchHttpError {
|
||||
fn error_code(&self) -> Code {
|
||||
match self {
|
||||
MeilisearchHttpError::MissingContentType => Code::MissingContentType,
|
||||
MeilisearchHttpError::InvalidContentType(_) => Code::InvalidContentType,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue