Improve error message

This commit is contained in:
Mubelotix
2025-08-19 14:29:07 +02:00
parent bfb6cdc16b
commit 2ddecc311f
2 changed files with 2 additions and 2 deletions

View File

@ -213,7 +213,7 @@ impl Display for Error<'_> {
writeln!(f, "The `_geoPolygon` filter expects at least 2 points")?;
}
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) => {
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())?

View File

@ -950,7 +950,7 @@ pub mod tests {
");
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])
");