Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lifeparticle committed Aug 26, 2024
1 parent 1ff7931 commit c7f23da
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/repo_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ def get_repo_meta_data(self, url):
# Will raise an HTTPError for bad responses
response.raise_for_status()
return response.json()
except requests.exceptions.HTTPError as e:
if response.status_code == 401:
print(f"Unauthorized access - 401 Client Error for URL: {url}. Exiting the program.")
sys.exit(1) # Exit the program with a non-zero exit code to indicate an error
else:
print(f"Error fetching data from {url}: {e}")
return None
except requests.RequestException as e:
print(f"Error fetching data from {url}: {e}")
return None
Expand Down

0 comments on commit c7f23da

Please sign in to comment.