Improve query error handling

This commit is contained in:
allegroai 2022-07-08 17:38:22 +03:00
parent b2feafac09
commit 123dc1dcfb

View File

@ -166,7 +166,10 @@ class MongoEngineErrorsHandler(object):
@classmethod
@throws_default_error(errors.server_error.InternalError)
def invalid_query_error(cls, e, message, **_):
pass
if e.args:
inner = e.args[0]
if isinstance(inner, LookUpError):
cls.lookup_error(inner, message)
@contextmanager