get_attribute currently catches KeyErrors and AttributeErrors when trying to retrieve fields, assuming that those errors resulted from the top level attribute getting or key getting.
The problem with this is that if anything else inside a property causes one of those errors, the traceback is swallowed and it's a nightmare to debug!
Is there maybe a way to make sure that the exception doesn't come from deeper down?
Contrived illustration:
E AttributeError: Got AttributeError when attempting to get a value for field my_prop on serializer WidgetSerializer.
E The serializer field might be named incorrectly and not match any attribute or key on the Widget instance.
E Original exception text was: 'something_entirely_unrelated' object has no attribute 'some_attribute'.
get_attributecurrently catchesKeyErrors andAttributeErrors when trying to retrieve fields, assuming that those errors resulted from the top level attribute getting or key getting.The problem with this is that if anything else inside a property causes one of those errors, the traceback is swallowed and it's a nightmare to debug!
Is there maybe a way to make sure that the exception doesn't come from deeper down?
Contrived illustration: