diff options
author | Håvard Pettersen <havardpe@oath.com> | 2021-10-11 15:14:18 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2021-10-12 08:59:46 +0000 |
commit | 7c3c8b50db1756fcf359852882b6cb116480c32c (patch) | |
tree | 4af029cf588cbd0f7ed1ef41742baf6a8a730df3 /searchlib | |
parent | 7287be4ea675f2fce66bdc528b56719b56079e4c (diff) |
avoid core and report issue
Diffstat (limited to 'searchlib')
-rw-r--r-- | searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp | 14 | ||||
-rw-r--r-- | searchlib/src/vespa/searchlib/attribute/not_implemented_attribute.cpp | 4 |
2 files changed, 13 insertions, 5 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp index 4cac7d0f2f1..14070388f7b 100644 --- a/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attribute_blueprint_factory.cpp @@ -36,6 +36,8 @@ #include <vespa/searchlib/tensor/dense_tensor_attribute.h> #include <vespa/vespalib/util/regexp.h> #include <vespa/vespalib/util/stringfmt.h> +#include <vespa/vespalib/util/exceptions.h> +#include <vespa/vespalib/util/issue.h> #include <sstream> #include <charconv> @@ -85,6 +87,7 @@ using vespalib::geo::ZCurve; using vespalib::make_string; using vespalib::string; using vespalib::stringref; +using vespalib::Issue; namespace search { namespace { @@ -799,9 +802,14 @@ AttributeBlueprintFactory::createBlueprint(const IRequestContext & requestContex if (attr == nullptr) { return std::make_unique<queryeval::EmptyBlueprint>(field); } - CreateBlueprintVisitor visitor(*this, requestContext, field, *attr); - const_cast<Node &>(term).accept(visitor); - return visitor.getResult(); + try { + CreateBlueprintVisitor visitor(*this, requestContext, field, *attr); + const_cast<Node &>(term).accept(visitor); + return visitor.getResult(); + } catch (const vespalib::UnsupportedOperationException &e) { + Issue::report(e); + return std::make_unique<queryeval::EmptyBlueprint>(field); + } } } // namespace search diff --git a/searchlib/src/vespa/searchlib/attribute/not_implemented_attribute.cpp b/searchlib/src/vespa/searchlib/attribute/not_implemented_attribute.cpp index ea42a73417b..f0043818367 100644 --- a/searchlib/src/vespa/searchlib/attribute/not_implemented_attribute.cpp +++ b/searchlib/src/vespa/searchlib/attribute/not_implemented_attribute.cpp @@ -11,8 +11,8 @@ using SearchContext = AttributeVector::SearchContext; void NotImplementedAttribute::notImplemented() const { - throw vespalib::IllegalStateException(fmt("The function is not implemented for attribute '%s' of type '%s'.", - getName().c_str(), getNativeClassName().c_str())); + throw vespalib::UnsupportedOperationException(fmt("The function is not implemented for attribute '%s' of type '%s'.", + getName().c_str(), getNativeClassName().c_str())); } uint32_t |