Skip to content

Commit 74302b8

Browse files
committed
Add proper logging for schema errors
1 parent f03628e commit 74302b8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/opentaskpy/config/schemas.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,11 @@ def validate_transfer_json(json_data: dict) -> bool:
215215
module_path = schema_dir
216216

217217
schema_def = {
218-
"$ref": Path(
219-
f"{module_path}/transfer/{destination_protocol}_destination.json"
220-
).as_uri()
218+
"$ref": (
219+
Path(
220+
f"{module_path}/transfer/{destination_protocol}_destination.json"
221+
).as_uri()
222+
)
221223
}
222224

223225
# If schema_refs does not already contain the schema_def, then append it
@@ -249,6 +251,7 @@ def validate_transfer_json(json_data: dict) -> bool:
249251

250252
except ValidationError as err:
251253
print(err.message) # noqa: T201
254+
logger.error(err.message)
252255
return False
253256
return True
254257

@@ -312,6 +315,7 @@ def validate_execution_json(json_data: dict) -> bool:
312315

313316
except ValidationError as err:
314317
print(err.message) # noqa: T201
318+
logger.error(err.message)
315319
return False
316320
return True
317321

@@ -337,5 +341,6 @@ def validate_batch_json(json_data: dict) -> bool:
337341

338342
except ValidationError as err:
339343
print(err.message) # noqa: T201
344+
logger.error(err.message)
340345
return False
341346
return True

0 commit comments

Comments
 (0)