Skip to content

Commit

Permalink
fix: refactoring + error handling
Browse files Browse the repository at this point in the history
Refs: #69
  • Loading branch information
grigoriev committed Sep 20, 2024
1 parent 0a38ace commit 39c9c19
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/SvgUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,14 @@ def convert_svg_to_png(width, height, png_filepath, svg_filepath):

try:
result = subprocess.run(command)
if result.returncode != 0:
logging.error(f"Error converting SVG to PNG, return code = {result.returncode}")
return False
return True
except Exception as e:
logging.error(f"Failed to convert SVG to PNG: {e}")
return False

if result.returncode != 0:
logging.error(f"Error converting SVG to PNG, return code = {result.returncode}")
return False

return True


# Read the PNG file and clean up the temporary file
def read_and_cleanup_png(png_filepath):
Expand Down

0 comments on commit 39c9c19

Please sign in to comment.