mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-12-23 21:20:24 +01:00
move filter parse error display to core
This commit is contained in:
parent
2bf82b3198
commit
2a32ad39a0
@ -160,6 +160,20 @@ impl fmt::Display for Error {
|
||||
|
||||
impl error::Error for Error {}
|
||||
|
||||
struct FilterParseError(PestError<Rule>);
|
||||
|
||||
impl fmt::Display for FilterParseError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
use crate::pest_error::LineColLocation::*;
|
||||
|
||||
let (line, column) = match self.0.line_col {
|
||||
Span((line, _), (column, _)) => (line, column),
|
||||
Pos((line, column)) => (line, column),
|
||||
};
|
||||
write!(f, "parsing error on line {} at column {}: {}", line, column, self.0.variant.message())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum FacetError {
|
||||
EmptyArray,
|
||||
|
Loading…
x
Reference in New Issue
Block a user