Skip to content

Commit

Permalink
refine some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry committed Jul 13, 2021
1 parent a837a12 commit cfa77e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion biothings/utils/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def store_value_to_db(self, name, value):
if name == "CONFIG_READONLY": # False -> True also not allowed.
raise RuntimeError("Runtime modification not allowed.")

try:
try: # already json?
json.loads(value)
except JSONDecodeError:
value = json.dumps(value)
Expand Down
7 changes: 6 additions & 1 deletion biothings/web/handlers/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,15 @@ def prepare(self):
# 'value': 100, # number of queries
})

def parse_exception(self, exception): # TODO merge this into ESQueryPipelineHandler
def parse_exception(self, exception):

message = super().parse_exception(exception)

# TODO merge this into ESQueryPipelineHandler
# or not? consider implications when we support
# additional discovery-like applications and
# eventually other than tornado web frameworks

if '_es_error' in message:
_es_error = message.pop('_es_error')
message['error'] = _es_error.error
Expand Down

0 comments on commit cfa77e1

Please sign in to comment.