From 0d46fb5fac3c7a1268618a3ec0a9956b79fdbeaf Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 16 Feb 2021 20:32:40 +0100 Subject: Revert undesirable changes --- fatcat_scholar/web.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fatcat_scholar/web.py') diff --git a/fatcat_scholar/web.py b/fatcat_scholar/web.py index 43a733a..dce732b 100644 --- a/fatcat_scholar/web.py +++ b/fatcat_scholar/web.py @@ -106,7 +106,7 @@ async def search(query: FulltextQuery = Depends(FulltextQuery)) -> FulltextHits: sentry_sdk.set_level("warning") sentry_sdk.capture_exception(e) raise HTTPException(status_code=400, detail=f"Query Error: {e}") - except OSError as e: + except IOError as e: sentry_sdk.capture_exception(e) raise HTTPException(status_code=500, detail=f"Backend Error: {e}") @@ -224,7 +224,7 @@ async def web_search( sentry_sdk.capture_exception(e) search_error = dict(type="query", message=str(e)) status_code = 400 - except OSError as e: + except IOError as e: sentry_sdk.capture_exception(e) search_error = dict(type="backend", message=str(e)) status_code = 500 @@ -282,8 +282,8 @@ async def favicon() -> Any: ) -ROBOTS_ALLOW = open("fatcat_scholar/static/robots.allow.txt").read() -ROBOTS_DISALLOW = open("fatcat_scholar/static/robots.disallow.txt").read() +ROBOTS_ALLOW = open("fatcat_scholar/static/robots.allow.txt", "r").read() +ROBOTS_DISALLOW = open("fatcat_scholar/static/robots.disallow.txt", "r").read() @app.get("/robots.txt", include_in_schema=False) -- cgit v1.2.3