Skip to content

Commit 9d71bdd

Browse files
committed
Do not catch Failure if pdal fails
1 parent 9dea86e commit 9d71bdd

File tree

1 file changed

+13
-21
lines changed

1 file changed

+13
-21
lines changed

packages/core/src/bag3d/core/assets/ahn/metadata.py

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -207,21 +207,13 @@ def compute_load_metadata(
207207
f"skipping computation."
208208
)
209209
return Output(None)
210-
try:
211-
ret_code, out_info = pdal_info(
212-
context.resources.pdal.app,
213-
file_path=laz_files_ahn.path,
214-
with_all=context.op_execution_context.op_config["all"],
215-
verbose=verbose,
216-
)
217-
if ret_code != 0:
218-
raise
219-
# if pdal fails store only the filename in the table (to be used later)
220-
except Exception as e:
221-
context.log.exception(
222-
f"PDAL failed for tile {tile_id} in {laz_files_ahn.path}: {e}"
223-
)
224-
out_info = {"filename": str(laz_files_ahn.path)}
210+
211+
ret_code, out_info = pdal_info(
212+
context.resources.pdal.app,
213+
file_path=laz_files_ahn.path,
214+
with_all=context.op_execution_context.op_config["all"],
215+
verbose=verbose,
216+
)
225217

226218
set_json_dumps(dumps=partial(json.dumps, ensure_ascii=False))
227219

@@ -240,14 +232,14 @@ def compute_load_metadata(
240232
insert_time,
241233
pdal_info,
242234
boundary
243-
)
235+
)
244236
VALUES (
245-
{tile_id},
246-
{hash},
247-
{insert_time},
248-
{pdal_info},
237+
{tile_id},
238+
{hash},
239+
{insert_time},
240+
{pdal_info},
249241
ST_SetSRID(ST_GeomFromGeoJSON({boundary}), 28992)
250-
);
242+
);
251243
""").format(**query_params)
252244
context.log.info(conn.print_query(query))
253245
conn.send_query(query)

0 commit comments

Comments
 (0)