aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbnewbold <bnewbold@archive.org>2021-03-22 19:30:03 +0000
committerbnewbold <bnewbold@archive.org>2021-03-22 19:30:03 +0000
commitf8a34492e7e1cfd5f55517e1344820e671194ee0 (patch)
tree7cd8875d7cd00e5e232666d2d9fe1fa32cb2b069
parent47b95829bd6be55312ed7f7e424adb2ec33164e8 (diff)
parent95d8a16a8ecd728059652b4b42a29326d2da0def (diff)
downloadfatcat-f8a34492e7e1cfd5f55517e1344820e671194ee0.tar.gz
fatcat-f8a34492e7e1cfd5f55517e1344820e671194ee0.zip
Merge branch 'martin-search-es-fix-none-info' into 'master'
search: exception info is optional See merge request webgroup/fatcat!98
-rw-r--r--python/fatcat_web/search.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/fatcat_web/search.py b/python/fatcat_web/search.py
index 6a419fa8..d7547cc8 100644
--- a/python/fatcat_web/search.py
+++ b/python/fatcat_web/search.py
@@ -130,7 +130,7 @@ def wrap_es_execution(search: Search) -> Any:
# all other errors
print("elasticsearch non-200 status code: {}".format(e.info), file=sys.stderr)
description = None
- if e.info.get("error", {}).get("root_cause", {}):
+ if e.info and e.info.get("error", {}).get("root_cause", {}):
description = str(e.info["error"]["root_cause"][0].get("reason"))
raise FatcatSearchError(e.status_code, str(e.error), description)
return resp