chore: Handle exceptions on external URL calls (#1334)

This commit is contained in:
Sojan Jose
2020-10-11 20:22:21 +05:30
committed by GitHub
parent 7d409321e9
commit 59bee66e63
6 changed files with 9 additions and 5 deletions

4
lib/exception_list.rb Normal file
View File

@@ -0,0 +1,4 @@
module ExceptionList
URI_EXCEPTIONS = [Errno::ETIMEDOUT, Errno::ECONNREFUSED, URI::InvalidURIError, Net::OpenTimeout, SocketError].freeze
REST_CLIENT_EXCEPTIONS = [RestClient::NotFound, RestClient::GatewayTimeout, RestClient::BadRequest, RestClient::MethodNotAllowed].freeze
end