Fixed broken error handling for long-running tasks
This commit is contained in:
parent
e3a27b024a
commit
a11d2145d9
5 changed files with 45 additions and 4 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import pprint
|
||||
import logging
|
||||
import copy
|
||||
|
||||
from werkzeug.exceptions import BadRequest
|
||||
|
||||
class JsonPayload:
|
||||
def __init__(self, request):
|
||||
|
|
@ -8,7 +9,11 @@ class JsonPayload:
|
|||
Object to wrap up simple functionality for parsing a JSON response.
|
||||
"""
|
||||
# Try to load as json
|
||||
self.json = request.get_json() #: dict: Dictionary representation of request JSON
|
||||
try:
|
||||
self.json = request.get_json() #: dict: Dictionary representation of request JSON
|
||||
except BadRequest as e:
|
||||
logging.error(e)
|
||||
self.json = {}
|
||||
|
||||
if self.json is None:
|
||||
self.json = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue