-
-
Save ellismarte/bea2e991f292cf3c9a8710860f2c8a08 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mojo_logger' | |
def action(arg) | |
new_data = [] | |
begin | |
arg["data"].each do |x| | |
begin | |
new_data << x + 1 | |
rescue StandardError => e | |
puts "mmm bad data dude " | |
puts "#{arg} #{e}" | |
end | |
end | |
# raise NoMethodError | |
rescue StandardError => e | |
puts "looks like you aint got no data bro" | |
puts "#{arg} #{e}" | |
end | |
new_data | |
end | |
p action({"data" => [1,2,3,4,5,6,7,8,9,0]}) | |
p action({"data" => ["1","2","3","4","5","6","7","8","9","0"]}) | |
p action({"daat" => [1,2,3,4,5,6,7,8,9,0]}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment