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"
|
$ref: "#/$defs/font-variation"
|
||||||
|
|
||||||
css:
|
css:
|
||||||
# https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face#descriptors
|
|
||||||
type: object
|
type: object
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
patternProperties:
|
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$"
|
? "^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
|
: type: string
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import copy
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
import click
|
import click
|
||||||
|
import jsonschema
|
||||||
|
|
||||||
import cmd_optimise
|
import cmd_optimise
|
||||||
import flags
|
import flags
|
||||||
@ -24,7 +25,12 @@ def cli(verbose, config, output_directory, clean, prefix):
|
|||||||
|
|
||||||
# Run
|
# Run
|
||||||
c = load(config)
|
c = load(config)
|
||||||
|
try:
|
||||||
validate(c)
|
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)
|
cmd_optimise.optimise(c)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user