diff options
Diffstat (limited to '')
| -rw-r--r-- | patternutils/commands/targs.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/patternutils/commands/targs.py b/patternutils/commands/targs.py index ff5c0b1..9bdf213 100644 --- a/patternutils/commands/targs.py +++ b/patternutils/commands/targs.py @@ -70,7 +70,14 @@ def targs( raise SystemExit if use_predefined_template: - command, template_engine = config.load_template(command, 'targs') + try: + command, template_engine = config.load_template(command, 'targs') + except FileNotFoundError: + click.secho('File not found!', fg='red', err=True) + raise SystemExit + except RuntimeError: + click.secho('Multiple files found!', fg='red', err=True) + raise SystemExit try: render = template.get_render_function(command, engine=template_engine) |
