Skip to content

Commit

Permalink
Fix for urllib3.exceptions has no attribute NameResolutionError
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed May 3, 2024
1 parent 45e9ebe commit 7c4314f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions llm_openrouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import json
import time
import httpx
import urllib3


def get_openrouter_models():
Expand Down Expand Up @@ -68,7 +67,7 @@ def fetch_cached_json(url, path, cache_timeout):
json.dump(response.json(), file)

return response.json()
except (httpx.HTTPError, urllib3.exceptions.NameResolutionError):
except httpx.HTTPError:
# If there's an existing file, load it
if path.is_file():
with open(path, "r") as file:
Expand Down

1 comment on commit 7c4314f

@simonw
Copy link
Owner Author

@simonw simonw commented on 7c4314f May 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closes #9

Please sign in to comment.