Exception: Excon::Errors::SocketError

Inherits:
Error
  • Object
show all
Defined in:
lib/excon/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(socket_error = Excon::Error.new) ⇒ SocketError


11
12
13
14
15
16
17
18
19
# File 'lib/excon/errors.rb', line 11

def initialize(socket_error=Excon::Error.new)
  if socket_error.message =~ /certificate verify failed/
    super("Unable to verify certificate, please set `Excon.defaults[:ssl_ca_path] = path_to_certs`, `ENV['SSL_CERT_DIR'] = path_to_certs`, `Excon.defaults[:ssl_ca_file] = path_to_file`, `ENV['SSL_CERT_FILE'] = path_to_file`, `Excon.defaults[:ssl_verify_callback] = callback` (see OpenSSL::SSL::SSLContext#verify_callback), or `Excon.defaults[:ssl_verify_peer] = false` (less secure).")
  else
    super("#{socket_error.message} (#{socket_error.class})")
  end
  set_backtrace(socket_error.backtrace)
  @socket_error = socket_error
end

Instance Attribute Details

#socket_errorObject (readonly)

Returns the value of attribute socket_error


9
10
11
# File 'lib/excon/errors.rb', line 9

def socket_error
  @socket_error
end