diff options
Diffstat (limited to 'src/mongo/db/matcher/expression_parser.h')
-rw-r--r-- | src/mongo/db/matcher/expression_parser.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/db/matcher/expression_parser.h b/src/mongo/db/matcher/expression_parser.h index 6091d3f1426..76f1e19c863 100644 --- a/src/mongo/db/matcher/expression_parser.h +++ b/src/mongo/db/matcher/expression_parser.h @@ -129,8 +129,12 @@ public: const ExtensionsCallback& extensionsCallback = ExtensionsCallbackNoop(), AllowedFeatureSet allowedFeatures = kDefaultSpecialFeatures) { invariant(expCtx.get()); - return MatchExpressionParser(&extensionsCallback) - ._parse(obj, expCtx, allowedFeatures, DocumentParseLevel::kPredicateTopLevel); + try { + return MatchExpressionParser(&extensionsCallback) + ._parse(obj, expCtx, allowedFeatures, DocumentParseLevel::kPredicateTopLevel); + } catch (const DBException& ex) { + return {ex.toStatus()}; + } } /** |