Skip to content

Commit

Permalink
pylint error.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Mael-J committed Feb 3, 2024
1 parent b33b9dc commit f968ddd
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions mstarpy/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,16 @@ def not_200_response(url,response):
"""
if not response.status_code == 200:
raise ConnectionError(f"Error {response.status_code} for the api {url}. Message : {response.reason}.")
raise ConnectionError(f"""Error {response.status_code}
for the api {url}. Message : {response.reason}.""")


def no_site_error(code, name, country, site):
"""
This function raise a ValueError if the selected country is "us" or a site is not selected.
"""


if not site or country == 'us':
if country:
raise ValueError(f"The funds of the country {country} cannot be scraped.")
else:
raise ValueError(f"The funds {name} ({code}) cannot be scraped.")




raise ValueError(f"The funds {name} ({code}) cannot be scraped.")

0 comments on commit f968ddd

Please sign in to comment.