summaryrefslogtreecommitdiffstats
path: root/CLI/ruby
diff options
context:
space:
mode:
authora14m <[email protected]>2021-02-17 15:17:41 +0100
committera14m <[email protected]>2021-02-17 15:17:41 +0100
commite43bb45122acef9d3d14bf2f84f8a971b675604f (patch)
treed67d14f14159a35c2299fbcbfe37d7afa493454d /CLI/ruby
parentb58228252d942357a04175d6f9b7d9a8be33e96c (diff)
Fix ~2 Name error when invalid numeric value passed
Diffstat (limited to 'CLI/ruby')
-rwxr-xr-xCLI/ruby/bin/game-of-life7
1 files changed, 4 insertions, 3 deletions
diff --git a/CLI/ruby/bin/game-of-life b/CLI/ruby/bin/game-of-life
index 08dbeca..5af474e 100755
--- a/CLI/ruby/bin/game-of-life
+++ b/CLI/ruby/bin/game-of-life
@@ -49,11 +49,12 @@ end
begin
CLI.start(ARGV)
-rescue SystemExit, Interrupt
+rescue Interrupt
# Print Seed/File used in previous run when user exits with Interrupt (CMD/Ctrl + C)
print "\e[?1049l"
print "#{GameOfLife::BANNER}\n\e[0m"
-rescue NotImplementedError, GameOfLife::Error => e
- print e.message
+ exit(0)
+rescue GameOfLife::Error => e
+ print "#{e.message}\n\e[0m"
exit(-1)
end