2 ms·
The two aren't equivalent (you're using a catchall exception handler in Ruby but not in Java, and are printing a stack trace in java but not in Ruby). Here's th
by wmoxam 3y ago
The two aren't equivalent (you're using a catchall exception handler in Ruby but not in Java, and are printing a stack trace in java but not in Ruby). Here's the equivalent Ruby:
begin
File.readlines('/path/to/your/file.txt').each {|line| puts line}
rescue Errno::ENOENT => e
puts e.backtrace
end