Is there a way to catch exceptions (that occur when accessing a property) on a per-field basis with marshmallow [1] ?
I want to use marshmallow to serialize documents of a mongo db (mongoengine) database. With nested schemas, referenced objects are serialized as well.
However, in case of a reference that does not exist, mongoengine throws an error. I would like to catch that error in the process of serialization ( e.g and set field null)
[1] library for converting complex datatypes, such as objects, to and from native Python datatypes https://marshmallow.readthedocs.io/en/3.0/api_reference.html