Skip to content

Commit

Permalink
main: fail gracefully on file not found
Browse files Browse the repository at this point in the history
  • Loading branch information
GiraffeReversed committed Nov 10, 2024
1 parent d7d4d32 commit 2e53a15
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion edulint/edulint.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,17 @@ def _update_check():
def check_code(args, option_parses):
cmd_args = get_cmd_args(args)

file_configs = get_config_many(args.files_or_dirs, cmd_args, option_parses=option_parses)
try:
file_configs = get_config_many(args.files_or_dirs, cmd_args, option_parses=option_parses)
except FileNotFoundError as e:
exception = str(e)
if exception.lower().startswith("[errno"):
assert "]" in exception
exception = exception[exception.index("]") + 2 :]
logger.opt(raw=True, colors=True).critical(
"<red>FileNotFoundError:</red> {exception}\n", exception=exception
)
return 3

try:
results = lint_many(file_configs)
Expand Down

0 comments on commit 2e53a15

Please sign in to comment.