From d3a5cb8569b84687b3e8f3e27382d4c9bf7f1125 Mon Sep 17 00:00:00 2001 From: litagin02 Date: Sun, 25 Feb 2024 18:56:45 +0900 Subject: [PATCH] Raise error instead of warning for visibility --- preprocess_text.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/preprocess_text.py b/preprocess_text.py index 7ba2310..2c26941 100644 --- a/preprocess_text.py +++ b/preprocess_text.py @@ -151,7 +151,10 @@ def preprocess( with open(config_path, "w", encoding="utf-8") as f: json.dump(json_config, f, indent=2, ensure_ascii=False) if error_count > 0: - logger.warning( + logger.error( + f"An error occurred in {error_count} lines. Please check {error_log_path} for details. You can proceed with lines that do not have errors." + ) + raise Exception( f"An error occurred in {error_count} lines. Please check {error_log_path} for details. You can proceed with lines that do not have errors." ) else: