diff options
| author | a14m <[email protected]> | 2021-02-17 15:17:41 +0100 |
|---|---|---|
| committer | a14m <[email protected]> | 2021-02-17 15:17:41 +0100 |
| commit | e43bb45122acef9d3d14bf2f84f8a971b675604f (patch) | |
| tree | d67d14f14159a35c2299fbcbfe37d7afa493454d | |
| parent | b58228252d942357a04175d6f9b7d9a8be33e96c (diff) | |
Fix ~2 Name error when invalid numeric value passed
| -rwxr-xr-x | CLI/ruby/bin/game-of-life | 7 |
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 |
