Safer handling of return statement inside of OperationLogMiddleware
Enclosing return statement in a try block. If object is unserializable
then return a message.
Change-Id: I184f4b10a419037d3ed770fbec42c262f03a89f2
Closes-bug: #1784438
(cherry picked from commit 27f619cf9b
)
This commit is contained in:
parent
ad60941e89
commit
ef21e65fac
|
@ -187,4 +187,7 @@ class OperationLogMiddleware(object):
|
|||
[up_file.name for up_file in files])
|
||||
params['file_name'] = filenames
|
||||
|
||||
return json.dumps(params, ensure_ascii=False)
|
||||
try:
|
||||
return json.dumps(params, ensure_ascii=False)
|
||||
except Exception:
|
||||
return 'Unserializable Object'
|
||||
|
|
Loading…
Reference in New Issue