diff --git a/rest_framework/fields.py b/rest_framework/fields.py index a5348922a..01e7c78c8 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -71,7 +71,11 @@ def get_attribute(instance, attrs): except ObjectDoesNotExist: return None if is_simple_callable(instance): - instance = instance() + try: + instance = instance() + except (AttributeError, KeyError) as exc: + raise ValueError('Exception raised in callable attribute "{0}"; original exception was: {1}'.format(attr, exc)) + return instance