Skip to content

Commit

Permalink
MRG: Merge branch 'main' of github.com:hyriver/pygeoogc [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Taher Chegini committed Sep 10, 2024
2 parents d73a8eb + 90cdaf0 commit c78567f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pygeoogc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

import async_retriever as ar
from pygeoogc import cache_keys
from pygeoogc.exceptions import InputTypeError, InputValueError, ServiceError
from pygeoogc.exceptions import InputTypeError, InputValueError, ServiceError, ServiceUnavailableError

if TYPE_CHECKING:
from typing_extensions import Self
Expand Down Expand Up @@ -853,7 +853,10 @@ def get_path(tag_list: list[str]) -> str:
return f"/{{{ns}}}".join(["", *tag_list])[1:]

kwds = {"params": {"service": "wms", "request": "GetCapabilities"}}
root = ETree.fromstring(ar.retrieve_text([url], [kwds], ssl=False)[0])
try:
root = ETree.fromstring(ar.retrieve_text([url], [kwds], ssl=False)[0])
except ETree.ParseError as ex:
raise ServiceUnavailableError(url) from ex
return [
t.text.lower() # pyright: ignore[reportOptionalMemberAccess]
for t in root.findall(get_path(["Capability", "Layer", "CRS"]))
Expand Down

0 comments on commit c78567f

Please sign in to comment.