Merge pull request #35881 from whiteinge/salt-api-catch-serializer-error

Add fail-safe in case Salt gives us data we can't serialize
This commit is contained in:
Mike Place 2016-08-30 15:43:11 +09:00 committed by GitHub
commit f0987cf27a

View file

@ -561,7 +561,12 @@ def hypermedia_handler(*args, **kwargs):
# Transform the output from the handler into the requested output format
cherrypy.response.headers['Content-Type'] = best
out = cherrypy.response.processors[best]
return out(ret)
try:
return out(ret)
except Exception:
msg = 'Could not serialize the return data from Salt.'
logger.debug(msg, exc_info=True)
raise cherrypy.HTTPError(500, msg)
def hypermedia_out():