From 58d7e3cd96bd0c87d86cbbdf9578e4d60c35d76d Mon Sep 17 00:00:00 2001 From: Nicola Soranzo Date: Tue, 20 Jul 2021 15:26:30 +0100 Subject: [PATCH] Raise exception if GET request returned an unsuccessful status code --- lib/galaxy/tool_util/deps/mulled/mulled_search.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/galaxy/tool_util/deps/mulled/mulled_search.py b/lib/galaxy/tool_util/deps/mulled/mulled_search.py index 633f6a7b2fa..eb1ad15cc5d 100755 --- a/lib/galaxy/tool_util/deps/mulled/mulled_search.py +++ b/lib/galaxy/tool_util/deps/mulled/mulled_search.py @@ -145,8 +145,9 @@ class GitHubSearch(): Takes search_string variable and return results from the bioconda-recipes github repository in JSON format """ response = requests.get( - "https://api.github.com/search/code?q=%s+in:path+repo:bioconda/bioconda-recipes+path:recipes" % search_string, timeout=MULLED_SOCKET_TIMEOUT).json() - return response + f"https://api.github.com/search/code?q={search_string}+in:path+repo:bioconda/bioconda-recipes+path:recipes", timeout=MULLED_SOCKET_TIMEOUT) + response.raise_for_status() + return response.json() def process_json(self, json, search_string): """