Skip to content

Commit

Permalink
🥅 Improve error handling in puzzle module import
Browse files Browse the repository at this point in the history
  • Loading branch information
advaithasabnis committed Dec 13, 2024
1 parent b1402d4 commit 657efa7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions advent_of_code/solve_puzzle.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ def run_puzzle(year: int, day: int, part: int):

try:
module = import_module(f'advent_of_code.year{year}.day{day:02d}.part{part}')
except ImportError:
print(f'\nError: Could not find puzzle solution for {year}, day{day}, part{part}')
except ImportError as e:
print(f'\nError: Could not find puzzle solution for {year}, day{day}, part{part}\n', e)
return

if not hasattr(module, 'main'):
Expand Down

0 comments on commit 657efa7

Please sign in to comment.