diff --git a/iata_code_fetcher/fetcher.py b/iata_code_fetcher/fetcher.py index 6ef8b4f..28ec1c6 100644 --- a/iata_code_fetcher/fetcher.py +++ b/iata_code_fetcher/fetcher.py @@ -114,8 +114,10 @@ def process_and_save_data(code_type: CodeType) -> None: with open(file_path, "a", encoding="UTF-8") as file: for item in result: file.write(json.dumps(item) + "\n") - except (ValueError, RequestException) as e: - logging.error("Error for %s: %s", code, e) + except RequestException as e: + logging.error("For %s: %s", code, e) + except ValueError as e: + logging.warn("For %s, %s", code, e) processed += 1 if processed % REPORT_FREQUENCY == 0: