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.
The HTTPException itself the following:
def __str__(self):
return str(self.detail) if self.detail else self.explanation
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.