mirror of
https://github.com/cupcakearmy/glyphance.git
synced 2024-12-22 08:06:29 +00:00
error handling
This commit is contained in:
parent
a9e3c19fb9
commit
3c73381642
@ -25,10 +25,10 @@ $defs:
|
||||
$ref: "#/$defs/font-variation"
|
||||
|
||||
css:
|
||||
# https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face#descriptors
|
||||
type: object
|
||||
additionalProperties: false
|
||||
patternProperties:
|
||||
# https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face#descriptors
|
||||
? "^ascent-override|descent-override|font-display|font-family|font-stretch|font-style|font-weight|font-feature-settings|font-variation-settings|line-gap-override|size-adjust|src|unicode-range$"
|
||||
: type: string
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
import copy
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
|
@ -1,5 +1,6 @@
|
||||
|
||||
import click
|
||||
import jsonschema
|
||||
|
||||
import cmd_optimise
|
||||
import flags
|
||||
@ -24,7 +25,12 @@ def cli(verbose, config, output_directory, clean, prefix):
|
||||
|
||||
# Run
|
||||
c = load(config)
|
||||
try:
|
||||
validate(c)
|
||||
except jsonschema.exceptions.ValidationError as e:
|
||||
click.echo(f"Config validation failed:")
|
||||
click.echo(f"{e.message} @ {e.json_path}")
|
||||
exit(1)
|
||||
cmd_optimise.optimise(c)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user