mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-06 04:36:32 +00:00
Improve error message
This commit is contained in:
@ -213,7 +213,7 @@ impl Display for Error<'_> {
|
|||||||
writeln!(f, "The `_geoPolygon` filter expects at least 2 points")?;
|
writeln!(f, "The `_geoPolygon` filter expects at least 2 points")?;
|
||||||
}
|
}
|
||||||
ErrorKind::GeoCoordinatesNotPair(number) => {
|
ErrorKind::GeoCoordinatesNotPair(number) => {
|
||||||
writeln!(f, "Expected coordinates in the form of a pair of numbers but found a group of {number} numbers instead.")?
|
writeln!(f, "Was expecting 2 coordinates but instead found {number}.")?
|
||||||
}
|
}
|
||||||
ErrorKind::ReservedGeo(name) => {
|
ErrorKind::ReservedGeo(name) => {
|
||||||
writeln!(f, "`{}` is a reserved keyword and thus can't be used as a filter expression. Use the `_geoRadius(latitude, longitude, distance)` or `_geoBoundingBox([latitude, longitude], [latitude, longitude])` built-in rules to filter on `_geo` coordinates.", name.escape_debug())?
|
writeln!(f, "`{}` is a reserved keyword and thus can't be used as a filter expression. Use the `_geoRadius(latitude, longitude, distance)` or `_geoBoundingBox([latitude, longitude], [latitude, longitude])` built-in rules to filter on `_geo` coordinates.", name.escape_debug())?
|
||||||
|
@ -950,7 +950,7 @@ pub mod tests {
|
|||||||
");
|
");
|
||||||
|
|
||||||
insta::assert_snapshot!(p("_geoPolygon([1,2],[1,2,3])"), @r"
|
insta::assert_snapshot!(p("_geoPolygon([1,2],[1,2,3])"), @r"
|
||||||
Expected coordinates in the form of a pair of numbers but found a group of 3 numbers instead.
|
Was expecting 2 coordinates but instead found 3.
|
||||||
20:21 _geoPolygon([1,2],[1,2,3])
|
20:21 _geoPolygon([1,2],[1,2,3])
|
||||||
");
|
");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user