mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 09:04:59 +08: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 {}
|
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)]
|
#[derive(Debug)]
|
||||||
pub enum FacetError {
|
pub enum FacetError {
|
||||||
EmptyArray,
|
EmptyArray,
|
||||||
|
Loading…
Reference in New Issue
Block a user