Skip to content

Commit

Permalink
fix: log gdal stderr instead of raising an exception TDE-557 (#203)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfouquet authored Nov 7, 2022
1 parent e6837ec commit 4032145
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions scripts/gdal/gdal_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ def run_gdal(
get_log().info("run_gdal_end", command=command_to_string(temp_command), duration=time_in_ms() - start_time)

if proc.stderr:
get_log().error("run_gdal_error", command=command_to_string(temp_command), error=proc.stderr.decode())
raise GDALExecutionException(proc.stderr.decode())
get_log().warning("run_gdal_stderr", command=command_to_string(temp_command), stderr=proc.stderr.decode())

get_log().debug("run_gdal_succeeded", command=command_to_string(temp_command), stdout=proc.stdout.decode())

Expand Down
4 changes: 1 addition & 3 deletions scripts/gdal/gdalinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ def gdal_info(path: str, file_check: Optional[FileCheck] = None) -> Dict[Any, An
else:
raise e
if gdalinfo_process.stderr:
get_log().error("Gdalinfo_error", file=path, error=str(gdalinfo_process.stderr))
if file_check:
# FIXME: do we want this recorded as an error in the non_visual_qa report?
file_check.add_error(error_type="gdalinfo", error_message=f"error(s): {str(gdalinfo_process.stderr)}")
else:
raise Exception(f"Gdalinfo Error {str(gdalinfo_process.stderr)}")
return gdalinfo_result
except GDALExecutionException as gee:
get_log().error("gdalinfo_failed", file=path, error=str(gee))
Expand Down

0 comments on commit 4032145

Please sign in to comment.