Browse Source

Better error handling

CPK 4 months ago
parent
commit
2073698a1e

+ 1 - 0
.github/workflows/localization/download-languages.py

@@ -156,6 +156,7 @@ def main():
     localization_data = load_ordered_json(LOCALIZATION_DATA_PATH)
     if "Languages" not in localization_data:
         print("::error::'Languages' key not found in LocalizationData.json")
+        exit(1)
         return
     
     has_changes = False

+ 1 - 0
.github/workflows/localization/reference-comparison.py

@@ -74,6 +74,7 @@ def main():
     remote_json = fetch_poeditor_json()
     if remote_json is None:
         print("::error::Failed to fetch POEditor en.json")
+        exit(1)
         return
     
     local_json = load_local_json()

+ 3 - 0
.github/workflows/localization/upload-reference.py

@@ -10,6 +10,7 @@ LOCAL_FILE_PATH = "src/PixiEditor/Data/Localization/Languages/en.json"
 def upload_en_json():
     if not API_KEY or not PROJECT_ID:
         print("::error::Missing POEDITOR_API_KEY or POEDITOR_PROJECT_ID environment variables.")
+        exit(1)
         return
 
     try:
@@ -39,9 +40,11 @@ def upload_en_json():
         else:
             print("::error::Upload failed:")
             print(result)
+            exit(1)
     else:
         print("::error::HTTP Error:", response.status_code)
         print(response.text)
+        exit(1)
 
 if __name__ == "__main__":
     upload_en_json()