Improve transformer error handling

This commit is contained in:
Joscha
2021-05-22 20:38:56 +00:00
parent 662191eca9
commit 1bbc0b705f
2 changed files with 23 additions and 15 deletions

View File

@ -7,6 +7,7 @@ from .cli import PARSER, load_default_section
from .config import Config, ConfigDumpError, ConfigLoadError, ConfigOptionError
from .logging import log
from .pferd import Pferd
from .transformer import RuleParseError
from .version import NAME, VERSION
@ -122,6 +123,10 @@ def main() -> None:
log.unlock()
log.error(str(e))
exit(1)
except RuleParseError as e:
log.unlock()
e.pretty_print()
exit(1)
except KeyboardInterrupt:
log.unlock()
log.explain_topic("Interrupted, exiting immediately")