mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
malformed payload error
This commit is contained in:
parent
137272b8de
commit
ddd40d87a7
3 changed files with 14 additions and 5 deletions
|
@ -2,6 +2,7 @@ use std::fmt;
|
|||
use std::io::{self, Read, Result as IoResult, Seek, Write};
|
||||
|
||||
use csv::{Reader as CsvReader, StringRecordsIntoIter};
|
||||
use meilisearch_error::{Code, ErrorCode};
|
||||
use milli::documents::DocumentBatchBuilder;
|
||||
use serde_json::{Deserializer, Map, Value};
|
||||
|
||||
|
@ -35,6 +36,15 @@ pub enum DocumentFormatError {
|
|||
),
|
||||
}
|
||||
|
||||
impl ErrorCode for DocumentFormatError {
|
||||
fn error_code(&self) -> Code {
|
||||
match self {
|
||||
DocumentFormatError::Internal(_) => Code::Internal,
|
||||
DocumentFormatError::MalformedPayload(_, _) => Code::MalformedPayload,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal_error!(DocumentFormatError: milli::documents::Error, io::Error);
|
||||
|
||||
macro_rules! malformed {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue