Skip to content

Commit

Permalink
Gracefully rescue NotImplementedError (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
egiurleo authored Dec 12, 2022
1 parent ce6d79e commit b972e6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/advent_of_code_cli/commands/example/solve.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def solution(module_name, part, input)
end

say "Took #{end_time - start_time} seconds to solve"
rescue NotImplementedError
say "Part #{part} has not yet been implemented", :yellow
end

def expected_answers
Expand Down
2 changes: 2 additions & 0 deletions lib/advent_of_code_cli/commands/solve.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def solution(module_name, part, input)

say "Part #{part} result: #{result}"
say "Took #{end_time - start_time} seconds to solve"
rescue NotImplementedError
say "Part #{part} has not yet been implemented", :yellow
end
end
end
Expand Down

0 comments on commit b972e6e

Please sign in to comment.