Skip to content

Commit

Permalink
Print out a more human readable error when selecting wrong security p…
Browse files Browse the repository at this point in the history
…rotocol

This change modifies the error message returned from nuage when selecting
the wrong security protocol. The old error message was: 'wrong status line:
"\x15\x03\x03\x00\x02\x02"' which was not informative to the end user.
  • Loading branch information
gasper-vrhovsek committed Nov 15, 2017
1 parent 377e47f commit 045482d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/models/manageiq/providers/nuage/manager_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def translate_exception(err)
MiqException::MiqHostError.new "Socket error: #{err.message}"
when MiqException::MiqInvalidCredentialsError, MiqException::MiqHostError
err
when Net::HTTPBadResponse
Net::HTTPBadResponse.new "Login failed due to a bad hostname and/or port and/or security protocol."
else
MiqException::MiqEVMLoginError.new "Unexpected response returned from system: #{err.message}"
end
Expand Down Expand Up @@ -92,10 +94,10 @@ def verify_api_credentials(options = {})
with_provider_connection(options) {}
true
rescue => err
_log.error("Error Class=#{err.class.name}, Message=#{err.message}")
miq_exception = translate_exception(err)
raise unless miq_exception

_log.error("Error Class=#{err.class.name}, Message=#{err.message}")
raise miq_exception
end

Expand Down

0 comments on commit 045482d

Please sign in to comment.