fecgov / fec-cms

The content management system (CMS) for the new Federal Election Commission website.
https://www.fec.gov
Other
96 stars 39 forks source link

RAD contact page goes down when servicenow API is down #3718

Closed lbeaufort closed 4 years ago

lbeaufort commented 4 years ago

The RAD contact page goes down when ServiceNow API is down. We should fall back to "look up your analyst" when we can't get to the ServiceNow API

How to test:

Example error:

2020-04-27T10:25:32.30-0400 [APP/PROC/WEB/2] ERR   File "/home/vcap/deps/0/python/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
   2020-04-27T10:25:32.30-0400 [APP/PROC/WEB/2] ERR     response = get_response(request)
   2020-04-27T10:25:32.30-0400 [APP/PROC/WEB/2] ERR   File "/home/vcap/deps/0/python/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
   2020-04-27T10:25:32.30-0400 [APP/PROC/WEB/2] ERR     response = self.process_exception_by_middleware(e, request)
   2020-04-27T10:25:32.30-0400 [APP/PROC/WEB/2] ERR   File "/home/vcap/deps/0/python/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
   2020-04-27T10:25:32.30-0400 [APP/PROC/WEB/2] ERR     response = wrapped_callback(request, *callback_args, **callback_kwargs)
   2020-04-27T10:25:32.30-0400 [APP/PROC/WEB/2] ERR   File "/home/vcap/app/fec/home/views.py", line 268, in contact_rad
   2020-04-27T10:25:32.30-0400 [APP/PROC/WEB/2] ERR     form = ContactRAD()
   2020-04-27T10:25:32.30-0400 [APP/PROC/WEB/2] ERR   File "/home/vcap/app/fec/fec/forms.py", line 17, in __init__
   2020-04-27T10:25:32.30-0400 [APP/PROC/WEB/2] ERR     category_options = [('', 'Choose a subject')] + form_categories()
   2020-04-27T10:25:32.30-0400 [APP/PROC/WEB/2] ERR   File "/home/vcap/app/fec/fec/forms.py", line 69, in form_categories
   2020-04-27T10:25:32.30-0400 [APP/PROC/WEB/2] ERR     raw_categories = fetch_categories()
   2020-04-27T10:25:32.30-0400 [APP/PROC/WEB/2] ERR   File "/home/vcap/app/fec/fec/forms.py", line 58, in fetch_categories
   2020-04-27T10:25:32.30-0400 [APP/PROC/WEB/2] ERR     return r.json()['result']
   2020-04-27T10:25:32.30-0400 [APP/PROC/WEB/2] ERR KeyError: 'result'
bmathesonFEC commented 4 years ago

@patphongs does your testing with the RAD contact page have anything to do with this ticket?