MCPcopy
hub / github.com/encode/django-rest-framework / wrap_attributeerrors

Function wrap_attributeerrors

rest_framework/request.py:68–78  ·  view source on GitHub ↗

Used to re-raise AttributeErrors caught during authentication, preventing these errors from otherwise being handled by the attribute access protocol.

()

Source from the content-addressed store, hash-verified

66
67@contextmanager
68def wrap_attributeerrors():
69 """
70 Used to re-raise AttributeErrors caught during authentication, preventing
71 these errors from otherwise being handled by the attribute access protocol.
72 """
73 try:
74 yield
75 except AttributeError:
76 info = sys.exc_info()
77 exc = WrappedAttributeError(str(info[1]))
78 raise exc.with_traceback(info[2])
79
80
81class Empty:

Callers 6

dataMethod · 0.85
userMethod · 0.85
authMethod · 0.85
POSTMethod · 0.85
FILESMethod · 0.85

Calls 1

Tested by

no test coverage detected