From c1bf2ecf3a40794836d2eafd84f1c28a1fe69ff0 Mon Sep 17 00:00:00 2001 From: wznmickey Date: Sat, 16 Sep 2023 02:50:59 +0800 Subject: [PATCH] feat: give hint when failed to find a team (#24) --- joint_teapot/workers/gitea.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/joint_teapot/workers/gitea.py b/joint_teapot/workers/gitea.py index bf8ca99..828f725 100644 --- a/joint_teapot/workers/gitea.py +++ b/joint_teapot/workers/gitea.py @@ -66,7 +66,9 @@ class Gitea: 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()