Commit bdee9a98 by Calen Pennington

Correctly catch RubricParsingErrors

parent fe7e420a
...@@ -5,7 +5,7 @@ import requests ...@@ -5,7 +5,7 @@ import requests
from dogapi import dog_stats_api from dogapi import dog_stats_api
from requests.exceptions import RequestException, ConnectionError, HTTPError from requests.exceptions import RequestException, ConnectionError, HTTPError
from .combined_open_ended_rubric import CombinedOpenEndedRubric from .combined_open_ended_rubric import CombinedOpenEndedRubric, RubricParsingError
from lxml import etree from lxml import etree
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
...@@ -153,10 +153,9 @@ class GradingService(object): ...@@ -153,10 +153,9 @@ class GradingService(object):
response_json['rubric'] = rubric_html response_json['rubric'] = rubric_html
return response_json return response_json
# if we can't parse the rubric into HTML, # if we can't parse the rubric into HTML,
except etree.XMLSyntaxError, RubricParsingError: except (etree.XMLSyntaxError, RubricParsingError):
#This is a dev_facing_error #This is a dev_facing_error
log.exception("Cannot parse rubric string. Raw string: {0}" log.exception("Cannot parse rubric string. Raw string: {0}".format(rubric))
.format(rubric))
return {'success': False, return {'success': False,
'error': 'Error displaying submission'} 'error': 'Error displaying submission'}
except ValueError: except ValueError:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment