mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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:
commit
f0987cf27a
1 changed files with 6 additions and 1 deletions
|
@ -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():
|
||||
|
|
Loading…
Add table
Reference in a new issue