Return a user error when the _vectors type is invalid

This commit is contained in:
Kerollmops 2023-06-20 16:18:24 +02:00 committed by Clément Renault
parent 7aa1275337
commit 531748c536
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
4 changed files with 27 additions and 7 deletions

View file

@ -112,6 +112,8 @@ only composed of alphanumeric characters (a-z A-Z 0-9), hyphens (-) and undersco
InvalidGeoField(#[from] GeoError),
#[error("Invalid vector dimensions: expected: `{}`, found: `{}`.", .expected, .found)]
InvalidVectorDimensions { expected: usize, found: usize },
#[error("The `_vectors` field in the document with the id: `{document_id}` is not an array. Was expecting an array of floats or an array of arrays of floats but instead got `{value}`.")]
InvalidVectorsType { document_id: Value, value: Value },
#[error("{0}")]
InvalidFilter(String),
#[error("Invalid type for filter subexpression: expected: {}, found: {1}.", .0.join(", "))]