Skip to content

Commit

Permalink
Add yaml error check
Browse files Browse the repository at this point in the history
Signed-off-by: Milosz Wasilewski <[email protected]>
  • Loading branch information
mwasilew committed Jan 24, 2025
1 parent d48195a commit fd508b7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions schemacheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
y = yaml.safe_load(f)
f.close()
validate(y)
except voluptuous.Invalid as exc:
except voluptuous.Invalid as e1:
print(f"{filename} is invalid")
print(exc.msg)
print(e1.msg)
exitcode += 1
except yaml.parser.ParserError as e2:
print(f"{filename} is invalid")
print(e2.msg)
exitcode += 1
print(f"{filename} is valid")
sys.exit(exitcode)
Expand Down

0 comments on commit fd508b7

Please sign in to comment.