def read_file file data = nil begin data = File.read(file) rescue Exception => e puts "#{e.inspect}" else puts "No exception." ensure puts "Always called" end return data end puts read_file "data_file_not_exists.txt" puts "---------------------------" puts read_file "data.txt"