From eb2b0a0161fce314bb8ecd7971c2ae3420d8a4d4 Mon Sep 17 00:00:00 2001 From: Paul Fouquet Date: Mon, 7 Nov 2022 11:35:20 +1300 Subject: [PATCH] fix: log gdal stderr instead of raising an exception TDE-557 --- scripts/gdal/gdal_helper.py | 3 +-- scripts/gdal/gdalinfo.py | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/gdal/gdal_helper.py b/scripts/gdal/gdal_helper.py index 277b0d78a..e53f3edfa 100644 --- a/scripts/gdal/gdal_helper.py +++ b/scripts/gdal/gdal_helper.py @@ -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()) diff --git a/scripts/gdal/gdalinfo.py b/scripts/gdal/gdalinfo.py index 56bf7506d..e1d14d355 100644 --- a/scripts/gdal/gdalinfo.py +++ b/scripts/gdal/gdalinfo.py @@ -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))