浏览代码

CI/linux-qt6/validate_json.py: Use sys.exit(1) instead of throwing Exception

Alexander Wilms 2 年之前
父节点
当前提交
1d206253e0
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      CI/linux-qt6/validate_json.py

+ 3 - 2
CI/linux-qt6/validate_json.py

@@ -1,6 +1,7 @@
 #!/usr/bin/env python3
 #!/usr/bin/env python3
 
 
 import re
 import re
+import sys
 from pathlib import Path
 from pathlib import Path
 from pprint import pprint
 from pprint import pprint
 
 
@@ -54,6 +55,6 @@ for path in sorted(Path(".").glob("**/*.json")):
         errors.append({"error_pos": error_pos, "error_msg": exc})
         errors.append({"error_pos": error_pos, "error_msg": exc})
 
 
 if errors:
 if errors:
-    print("Summary of errors:")
+    print("The following JSON files are invalid:")
     pprint(errors)
     pprint(errors)
-    raise Exception("Not all JSON files are valid")
+    sys.exit(1)