From 7737bef237235883115c799fe8d9e3a7c55e42ec Mon Sep 17 00:00:00 2001 From: a14m Date: Tue, 8 Dec 2020 13:43:37 +0100 Subject: Fix error handling with exact namespaces (and required stdlibs) --- CLI/ruby/lib/game_of_life/generators/input.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'CLI/ruby/lib/game_of_life/generators/input.rb') diff --git a/CLI/ruby/lib/game_of_life/generators/input.rb b/CLI/ruby/lib/game_of_life/generators/input.rb index 3082e70..79626d4 100644 --- a/CLI/ruby/lib/game_of_life/generators/input.rb +++ b/CLI/ruby/lib/game_of_life/generators/input.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require "open-uri" +require "socket" module GameOfLife module Generators @@ -22,9 +23,9 @@ module GameOfLife # where any alpha numeric character is considered a living cell (true) raw.map! { |row| row.chars.map { |char| char.match?(/[[:alnum:]]/) } } populate(parsed_input: raw, width: options["width"].to_i, height: options["height"].to_i) - rescue OpenURI::HTTPError, SocketError + rescue ::OpenURI::HTTPError, ::SocketError raise GameOfLife::Error, "URL isn't avaialable, please check it again and make sure the URL is correct" - rescue Errno::ENOENT + rescue ::Errno::ENOENT raise GameOfLife::Error, "File isn't avaialable, please check it again and make sure the path to the input file is correct" end -- cgit v1.2.3