Skip to content

Commit

Permalink
feat: give hint when failed to find a team (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
wznmickey authored Sep 15, 2023
1 parent 666d62b commit c1bf2ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion joint_teapot/workers/gitea.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ def __init__(
def _get_team_id_by_name(self, name: str) -> int:
res = self.organization_api.team_search(self.org_name, q=str(name), limit=1)
if len(res["data"] or []) == 0:
raise Exception(f"{name} not found by name in Gitea")
raise Exception(
f"{name} not found by name in Gitea. Possible reason: you did not join this team."
)
return res["data"][0]["id"]

@lru_cache()
Expand Down

0 comments on commit c1bf2ec

Please sign in to comment.