Skip to content

Commit

Permalink
Small improvements to error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jherbel committed May 15, 2024
1 parent 508b265 commit dff7a67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion checkmk_weblate_syncer/po.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def _process_po_file_pair(
return _Failure(
error_message=f"Found formatting errors: {e.stderr}", path=locale_po_file
)
except Exception as e: # pylint: disable=broad-except
except IOError as e:
return _Failure(error_message=str(e), path=locale_po_file)

LOGGER.info("Removing unwanted lines from %s", locale_po_file)
Expand Down
4 changes: 2 additions & 2 deletions checkmk_weblate_syncer/pot.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ def run(config: PotModeConfig) -> int:
e.stderr,
)
raise e
except Exception as e:
except IOError as e:
LOGGER.error("Generating pot file failed")
raise e

LOGGER.info("Writing pot file to locale repository")
path_pot_file = config.locale_repository.path / config.locale_pot_path
try:
path_pot_file.write_text(completed_pot_generation_process.stdout)
except Exception as e:
except IOError as e:
LOGGER.error("Writing pot file failed")
raise e

Expand Down

0 comments on commit dff7a67

Please sign in to comment.