committing my homework after lesson 03

@slead in Ruby we try to avoid raising exceptions as it is costly, instead we validate the data. So in your case the following approach should work
if value.is_a?(Integer)
  x = value.to_i
else
  exit
end

or something along those lines