diff --git a/xexe/processes.py b/xexe/processes.py index cf382f6..30a9276 100644 --- a/xexe/processes.py +++ b/xexe/processes.py @@ -6,7 +6,14 @@ from xecd_rates_client import XecdClient logger = logging.getLogger() -def run_xe_healthcheck(): +def run_xe_healthcheck() -> None: + """ + Try to request the account data in xe.com's API. + + If certain fields about the account are returned, it means the request was + successful. + + """ logger.info("Creating client.") xecd = XecdClient( account_id=os.environ["XE_ACCOUNT_ID"], @@ -29,6 +36,7 @@ def run_xe_healthcheck(): and ("package" in account_info_response.keys()), ) if not contains_good_response_fields: + logger.error("Didn't find the fields of a good response.") raise ConnectionError("Response from xe.com is not successful.") logger.info("xe.com reached successfully.")