diff options
author | Bryan Newbold <bnewbold@archive.org> | 2020-12-07 18:42:30 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2020-12-22 18:20:04 -0800 |
commit | d14248b7f1fea2053ea0b13d259256479e463f18 (patch) | |
tree | 78ac47b4b9ccfa30207d35a8ce58f9cc7273b1e3 | |
parent | 77145b27cb0d5bf03694ae03fe55584228bb8b0a (diff) | |
download | fatcat-scholar-d14248b7f1fea2053ea0b13d259256479e463f18.tar.gz fatcat-scholar-d14248b7f1fea2053ea0b13d259256479e463f18.zip |
work around mypy complaint about exception union type
-rw-r--r-- | fatcat_scholar/search.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fatcat_scholar/search.py b/fatcat_scholar/search.py index 5a4d47f..b57a16d 100644 --- a/fatcat_scholar/search.py +++ b/fatcat_scholar/search.py @@ -314,8 +314,9 @@ def do_fulltext_search( query_start = datetime.datetime.now() try: resp = search.execute() - except elasticsearch.exceptions.RequestError as e: + except elasticsearch.exceptions.RequestError as e_raw: # this is a "user" error + e: Any = e_raw logging.warn("elasticsearch 400: " + str(e.info)) if e.info.get("error", {}).get("root_cause", {}): raise ValueError(str(e.info["error"]["root_cause"][0].get("reason"))) from e |