Skip to content
This repository has been archived by the owner on Sep 29, 2022. It is now read-only.

Add new error messages and rescuing #10

Merged
merged 1 commit into from
Mar 19, 2018

Conversation

fakenine
Copy link
Contributor

@fakenine fakenine commented Mar 8, 2018

Add new error messages and rescuing to better contextualize and understand errors when using the client.

@coveralls
Copy link

coveralls commented Mar 8, 2018

Coverage Status

Coverage increased (+1.4%) to 75.107% when pulling 8539bad on fakenine:add_error_messages into 3920638 on Cyberwatch:master.

Copy link
Member

@fwininger fwininger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have one commit that already been merge. Please rebase before contributing.

@@ -8,8 +8,8 @@ class InvalidLogin < StandardError; end

# Do Login
def self.login
raise InvalidLogin, 'Please configure the username' unless Openvas::Config.username
raise InvalidLogin, 'Please configure the password' unless Openvas::Config.password
raise ConfigError, 'Username not configured' unless Openvas::Config.username
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should remove the class InvalidLogin

socket.connect
rescue Errno::ECONNREFUSED, OpenSSL::SSL::SSLError, SocketError,
URI::InvalidURIErro => e
raise ConfigError, e
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should raise something like a ConnectionError

socket.close
self.socket = nil
rescue SocketError => e
raise ConfigError, e
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should raise something like a ConnectionError

@fwininger fwininger merged commit 2dbf2b1 into Cyberwatch:master Mar 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants