Skip to content

Commit

Permalink
fix: handle invalid description search from aspen (#340)
Browse files Browse the repository at this point in the history
* fix: handle invalid description search from aspen

* style: pre-commit
  • Loading branch information
asmfstatoil authored Jun 3, 2024
1 parent bb2d180 commit 39a9364
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tagreader/web_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -523,11 +523,13 @@ def generate_get_description_query(self, tag: str):
def _get_tag_description(self, tag: str):
query = self.generate_get_description_query(tag)
url = urljoin(self.base_url, "TagInfo")
data = self.fetch(url, params=query)
try:
data = self.fetch(url, params=query)
desc = data["data"]["tags"][0]["attrData"][0]["samples"][0]["v"]
except KeyError:
desc = ""
except JSONDecodeError:
desc = ""
return desc

def read_tag(
Expand Down

0 comments on commit 39a9364

Please sign in to comment.