What would be a prettier/faster way to do handling of multiple errors in Ruby? Here is the code I am working with:
begin
response = session.get url
rescue Patron::HostResolutionError
puts "Error resolving remote host."
exit 1
rescue Patron::PartialFileError
puts "File size mismatch. (Host reported a file size, but the actual file is of different size)"
exit 1
rescue Patron::TimeoutError
puts "Operation timed out."
exit 1
rescue Patron::TooManyRedirects
puts "Tried redirecting too many times."
exit 1
rescue Patron::URLFormatError
puts "Error with the URL format"
exit 1
rescue Patron::UnsupportedProtocol
puts "This URL is using a protocol that we cannot handle."
exit 1
rescue Patron::ConnectionFailed
puts "Error connecting to host. Check your internet connection."
exit 1
end