You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Somewhat like #275, but since it dates from 2015, things changed a lot in the code.
Because cornice.renderer.JSONError inherits from pyramid.httpexceptions.HTTPError, its __str__ implementation looks for the detail attribute. A simple logging call such as logger.info("exception: {!s}", err) is enough to cause this exception to crash.
So either the JSON body could be set to detail and let it represent it as plain string, or define detail/explanation accordingly with some more explicit message.
The text was updated successfully, but these errors were encountered:
Because the Response.__init__ is called rather than HTTPError.__init__, not all attributes expected by this class get properly assigned, and notably, the detail attribute that is defined only under HTTPError, and not Response.
Somewhat like #275, but since it dates from 2015, things changed a lot in the code.
Because
cornice.renderer.JSONError
inherits frompyramid.httpexceptions.HTTPError
, its__str__
implementation looks for thedetail
attribute. A simple logging call such aslogger.info("exception: {!s}", err)
is enough to cause this exception to crash.The
HTTPException
itself the following:So either the JSON
body
could be set todetail
and let it represent it as plain string, or definedetail
/explanation
accordingly with some more explicit message.The text was updated successfully, but these errors were encountered: