summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/query/properties
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@yahooinc.com>2023-08-03 11:03:10 +0200
committerBjørn Christian Seime <bjorncs@yahooinc.com>2023-08-03 11:03:10 +0200
commit0fd1d524e5edbe4f197327bfc9cb81596a15350b (patch)
treef4d94f12976f55a669f173fec42eaf75e2d3886e /container-search/src/main/java/com/yahoo/search/query/properties
parent0f46015e498ecb622473cd3e2403283c99f9f5d5 (diff)
Use `IllegalInputException` to ensure invalid query is returned as 400 response
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/query/properties')
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/properties/RankProfileInputProperties.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/properties/RankProfileInputProperties.java b/container-search/src/main/java/com/yahoo/search/query/properties/RankProfileInputProperties.java
index 6c65a5e898a..6203eadffad 100644
--- a/container-search/src/main/java/com/yahoo/search/query/properties/RankProfileInputProperties.java
+++ b/container-search/src/main/java/com/yahoo/search/query/properties/RankProfileInputProperties.java
@@ -3,6 +3,7 @@ package com.yahoo.search.query.properties;
import com.yahoo.api.annotations.Beta;
import com.yahoo.language.process.Embedder;
+import com.yahoo.processing.IllegalInputException;
import com.yahoo.processing.request.CompoundName;
import com.yahoo.search.Query;
import com.yahoo.search.schema.SchemaInfo;
@@ -46,7 +47,7 @@ public class RankProfileInputProperties extends Properties {
query.getModel().getLanguage());
}
catch (IllegalArgumentException e) {
- throw new IllegalArgumentException("Could not set '" + name + "' to '" + value + "'", e);
+ throw new IllegalInputException("Could not set '" + name + "' to '" + value + "'", e);
}
}
}
@@ -84,7 +85,7 @@ public class RankProfileInputProperties extends Properties {
}
private void throwIllegalInput(CompoundName name, Object value, TensorType expectedType) {
- throw new IllegalArgumentException("Could not set '" + name + "' to '" + value + "': " +
+ throw new IllegalInputException("Could not set '" + name + "' to '" + value + "': " +
"This input is declared in rank profile '" + query.getRanking().getProfile() +
"' as " + expectedType);
}