mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-27 00:31:02 +00:00
draft without error handling
This commit is contained in:
@ -62,6 +62,9 @@ pub enum UserError {
|
||||
InvalidFilter(pest::error::Error<ParserRule>),
|
||||
InvalidFilterAttribute(pest::error::Error<ParserRule>),
|
||||
InvalidGeoField { document_id: Value, object: Value },
|
||||
InvalidFilterAttributeNom,
|
||||
InvalidFilterValue,
|
||||
InvalidSortName { name: String },
|
||||
InvalidSortableAttribute { field: String, valid_fields: HashSet<String> },
|
||||
SortRankingRuleMissing,
|
||||
InvalidStoreFile,
|
||||
@ -82,6 +85,11 @@ impl From<io::Error> for Error {
|
||||
Error::IoError(error)
|
||||
}
|
||||
}
|
||||
impl From<std::num::ParseFloatError> for UserError {
|
||||
fn from(_: std::num::ParseFloatError) -> UserError {
|
||||
UserError::InvalidFilterValue
|
||||
}
|
||||
}
|
||||
|
||||
impl From<fst::Error> for Error {
|
||||
fn from(error: fst::Error) -> Error {
|
||||
@ -208,6 +216,9 @@ impl StdError for InternalError {}
|
||||
impl fmt::Display for UserError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self {
|
||||
//TODO
|
||||
Self::InvalidFilterAttributeNom => f.write_str("parser error "),
|
||||
Self::InvalidFilterValue => f.write_str("parser error "),
|
||||
Self::AttributeLimitReached => f.write_str("maximum number of attributes reached"),
|
||||
Self::CriterionError(error) => write!(f, "{}", error),
|
||||
Self::DocumentLimitReached => f.write_str("maximum number of documents reached"),
|
||||
|
Reference in New Issue
Block a user