Slide 26
Slide 26 text
module NetworkErrors
extend self
ERRORS = [
EOFError,
Errno::ECONNRESET,
Errno::EINVAL,
Net::HTTPBadResponse,
Net::HTTPHeaderSyntaxError,
Net::ProtocolError,
Timeout::Error,
# ...
]
def ===(error)
ERRORS.any? { |error_class| error_class === error }
end
end