mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 04:17:10 +02:00
recreate most filter error except for the geosearch
This commit is contained in:
parent
7328ffb034
commit
8234f9fdf3
4 changed files with 73 additions and 32 deletions
|
@ -71,6 +71,10 @@ impl<'a> Error<'a> {
|
|||
Self { context, kind }
|
||||
}
|
||||
|
||||
pub fn new_from_external(context: Span<'a>, error: impl std::error::Error) -> Self {
|
||||
Self::new_from_kind(context, ErrorKind::External(error.to_string()))
|
||||
}
|
||||
|
||||
pub fn char(self) -> char {
|
||||
match self.kind {
|
||||
ErrorKind::Char(c) => c,
|
||||
|
|
|
@ -69,6 +69,10 @@ impl<'a> Token<'a> {
|
|||
pub fn new(position: Span<'a>) -> Self {
|
||||
Self { position, inner: &position }
|
||||
}
|
||||
|
||||
pub fn as_external_error(&self, error: impl std::error::Error) -> Error<'a> {
|
||||
Error::new_from_external(self.position, error)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<Span<'a>> for Token<'a> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue