Skip to content

Commit

Permalink
Convert jsonschema error to CallError
Browse files Browse the repository at this point in the history
  • Loading branch information
anodos325 committed Sep 13, 2023
1 parent 088481f commit a90763e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scale_build/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ def validate_system_state():


def validate_datasets():
jsonschema.validate(fhs.TRUENAS_DATASETS, fhs.TRUENAS_DATASET_SCHEMA)
try:
jsonschema.validate(fhs.TRUENAS_DATASETS, fhs.TRUENAS_DATASET_SCHEMA)
except jsonschema.ValidationError as e:
raise CallError(f'Provided dataset schema is invalid: {e}')


def validate(system_state_flag=True, manifest_flag=True, datasets_flag=True):
Expand Down

0 comments on commit a90763e

Please sign in to comment.