Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors on initial load if fetches fail #39

Open
textbook opened this issue Nov 4, 2019 · 0 comments
Open

Errors on initial load if fetches fail #39

textbook opened this issue Nov 4, 2019 · 0 comments
Assignees
Labels
bug

Comments

@textbook
Copy link
Owner

@textbook textbook commented Nov 4, 2019

By default, the various update implementations return an empty dictionary if something goes wrong. This is not gracefully handled by the initial load templating:

   2019-11-04T22:31:43.79+0000 [APP/PROC/WEB/0] OUT   File "/home/vcap/app/flash/templates/home.html", line 1, in top-level template code
   2019-11-04T22:31:43.79+0000 [APP/PROC/WEB/0] OUT     {% extends "base.html" %}
   2019-11-04T22:31:43.79+0000 [APP/PROC/WEB/0] OUT   File "/home/vcap/app/flash/templates/base.html", line 20, in top-level template code
   2019-11-04T22:31:43.79+0000 [APP/PROC/WEB/0] OUT     {% block body %}{% endblock %}
   2019-11-04T22:31:43.79+0000 [APP/PROC/WEB/0] OUT   File "/home/vcap/app/flash/templates/home.html", line 15, in block "body"
   2019-11-04T22:31:43.79+0000 [APP/PROC/WEB/0] OUT     {% include template %}
   2019-11-04T22:31:43.79+0000 [APP/PROC/WEB/0] OUT   File "/home/vcap/app/flash/templates/partials/vcs-section.html", line 3, in top-level template code
   2019-11-04T22:31:43.79+0000 [APP/PROC/WEB/0] OUT     {% set commit_data = service_data['commits'][i] or {} %}
   2019-11-04T22:31:43.79+0000 [APP/PROC/WEB/0] OUT   File "/home/vcap/deps/0/python/lib/python3.7/site-packages/jinja2/environment.py", line 411, in getitem
   2019-11-04T22:31:43.79+0000 [APP/PROC/WEB/0] OUT     return obj[argument]
   2019-11-04T22:31:43.79+0000 [APP/PROC/WEB/0] OUT jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'commits'
   2019-11-04T22:31:43.79+0000 [APP/PROC/WEB/0] OUT INFO:werkzeug:10.253.7.131 - - [04/Nov/2019 22:31:43] "GET / HTTP/1.1" 500 -
@textbook textbook added the bug label Nov 4, 2019
@textbook textbook self-assigned this Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.