Skip to content

Commit

Permalink
Merge pull request #53 from padovan/fix-missing-config-error-msg
Browse files Browse the repository at this point in the history
config: show a nice error message if not config is available
  • Loading branch information
aliceinwire authored Dec 6, 2024
2 parents 92d6e37 + 2e03708 commit 46a699d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kcidev/libs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import os

import click
import toml


Expand All @@ -26,6 +27,10 @@ def load_toml(settings):
config = toml.load(f)

if not config:
raise FileNotFoundError("No configuration file found")
click.secho(
f"No `{fname}` configuration file found at `{global_path}`, `{user_path}` or `{settings}`",
fg="red",
)
raise click.Abort()

return config

0 comments on commit 46a699d

Please sign in to comment.