summaryrefslogtreecommitdiffstats
path: root/document
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahooinc.com>2022-12-08 14:49:37 +0000
committerTor Brede Vekterli <vekterli@yahooinc.com>2022-12-08 15:03:03 +0000
commit2cfbddfcdfcb0bc4ddbea6b3c052a63bf789e74d (patch)
tree1bd2043074d762171dd8576545773c75d8f2e488 /document
parent8155297ab10734cb58f6b9303bea033c2a940771 (diff)
Improve error response when trying to use an imported field in a condition
We don't support using imported fields in conditional mutations, so catch attempts at doing this during the field enumeration that is done as part of the condition evaluation. Would previously get an internal error response with an ugly stack trace since the exception would propagate up to a generic exception-to-response handler. Will now generate an `ILLEGAL_PARAMETERS` error response with a hopefully helpful error message.
Diffstat (limited to 'document')
-rw-r--r--document/src/vespa/document/base/testdocrepo.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/document/src/vespa/document/base/testdocrepo.cpp b/document/src/vespa/document/base/testdocrepo.cpp
index 8dcb2d66410..d67f44ee731 100644
--- a/document/src/vespa/document/base/testdocrepo.cpp
+++ b/document/src/vespa/document/base/testdocrepo.cpp
@@ -58,6 +58,7 @@ DocumenttypesConfig TestDocRepo::getDefaultConfig() {
.addTensorField("sparse_xy_tensor", "tensor(x{},y{})")
.addTensorField("sparse_float_tensor", "tensor<float>(x{})")
.addTensorField("dense_tensor", "tensor(x[2])"))
+ .imported_field("my_imported_field")
.doc_type.fieldsets["[document]"].fields.swap(documentfields);
builder.document(type2_id, "testdoctype2",