-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Description
If the json serializer fails, the traceback doesn't indicate which object couldn't be serialized or where to find it. For large apps, this becomes really difficult to track down. For example:
Traceback (most recent call last):
File "/Users/chriddyp/Repos/dash-stuff/my-project/venv/lib/python3.6/site-packages/flask/app.py", line 2309, in __call__
return self.wsgi_app(environ, start_response)
File "/Users/chriddyp/Repos/dash-stuff/my-project/venv/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/Users/chriddyp/Repos/dash-stuff/my-project/venv/lib/python3.6/site-packages/flask/app.py", line 1741, in handle_exception
reraise(exc_type, exc_value, tb)
File "/Users/chriddyp/Repos/dash-stuff/my-project/venv/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/Users/chriddyp/Repos/dash-stuff/my-project/venv/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/Users/chriddyp/Repos/dash-stuff/my-project/venv/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/chriddyp/Repos/dash-stuff/my-project/venv/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Users/chriddyp/Repos/dash-stuff/my-project/venv/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
raise value
File "/Users/chriddyp/Repos/dash-stuff/my-project/venv/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/chriddyp/Repos/dash-stuff/my-project/venv/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Users/chriddyp/Repos/dash-stuff/my-project/venv/lib/python3.6/site-packages/dash/dash.py", line 556, in dispatch
return self.callback_map[target_id]['callback'](*args)
File "/Users/chriddyp/Repos/dash-stuff/my-project/venv/lib/python3.6/site-packages/dash/dash.py", line 524, in add_context
cls=plotly.utils.PlotlyJSONEncoder),
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/__init__.py", line 238, in dumps
**kw).encode(obj)
File "/Users/chriddyp/Repos/dash-stuff/my-project/venv/lib/python3.6/site-packages/plotly/utils.py", line 136, in encode
encoded_o = super(PlotlyJSONEncoder, self).encode(o)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/encoder.py", line 199, in encode
chunks = self.iterencode(o, _one_shot=True)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/encoder.py", line 257, in iterencode
return _iterencode(o, 0)
File "/Users/chriddyp/Repos/dash-stuff/my-project/venv/lib/python3.6/site-packages/plotly/utils.py", line 204, in default
return _json.JSONEncoder.default(self, obj)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/encoder.py", line 180, in default
o.__class__.__name__)
TypeError: Object of type 'function' is not JSON serializable
Metadata
Metadata
Assignees
Labels
No labels