Skip to content

Commit

Permalink
fix: GDAL error was not logged when command run fails (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfouquet authored Jul 18, 2022
1 parent 5387093 commit 01d941e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions scripts/gdal_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,11 @@ def run_gdal(command: List[str], input_file: str = "", output_file: str = "") ->

if output_file:
command.append(output_file)

try:
get_log().debug("run_gdal", command=command_to_string(command))
proc = subprocess.run(
command,
env=gdal_env,
check=True,
capture_output=True,
)
proc = subprocess.run(command, env=gdal_env, check=True, capture_output=True)
except subprocess.CalledProcessError as cpe:
get_log().error("run_gdal_failed", command=command_to_string(command))
get_log().error("run_gdal_failed", command=command_to_string(command), error=str(cpe.stderr, "utf-8"))
raise cpe
get_log().debug("run_gdal_translate_succeded", command=command_to_string(command))

Expand Down

0 comments on commit 01d941e

Please sign in to comment.