From cd583f7822a5aaa29f09cc9ba016b6b23c1d9cc2 Mon Sep 17 00:00:00 2001 From: Aradhya Date: Wed, 23 Mar 2022 18:20:49 +0530 Subject: [PATCH] refactor: Added messages on invalid remote exceptions --- bench/utils/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bench/utils/__init__.py b/bench/utils/__init__.py index 8f4cc05c..b815fb3a 100644 --- a/bench/utils/__init__.py +++ b/bench/utils/__init__.py @@ -66,7 +66,7 @@ def is_valid_frappe_branch(frappe_path:str, frappe_branch:str): try: owner, repo = frappe_path.split("/")[3], frappe_path.split("/")[4] except IndexError: - raise InvalidRemoteException + raise InvalidRemoteException("Invalid git url") git_api_req = f"https://api.github.com/repos/{owner}/{repo}/branches" res = requests.get(git_api_req).json() @@ -74,10 +74,10 @@ def is_valid_frappe_branch(frappe_path:str, frappe_branch:str): # slower alternative with no rate limit github_req = f'https://github.com/{owner}/{repo}/tree/{frappe_branch}' if requests.get(github_req).status_code != 200: - raise InvalidRemoteException + raise InvalidRemoteException("Invalid git url") elif frappe_branch not in [x["name"] for x in res]: - raise InvalidRemoteException + raise InvalidRemoteException("Frappe branch does not exist") def log(message, level=0, no_log=False):