Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proper error message if network type not supported #222

Merged
merged 1 commit into from
Feb 5, 2018

Conversation

alexander-demicev
Copy link

@alexander-demicev alexander-demicev commented Feb 2, 2018

When creating network, add proper error message if network type is not supported by provider.
Fixes link
screen shot 2018-02-02 at 13 22 10

@alexander-demicev alexander-demicev force-pushed the add-error-msg branch 3 times, most recently from 417bb99 to 149c02c Compare February 2, 2018 15:18
parsed_error = parse_error_message_from_neutron_response(e)
if parsed_error =~ /Invalid input for operation: network_type value '.*' not supported\./
error_message = _("Network type '#{options[:provider_network_type]}' is not supported by the Provider")
raise MiqException::MiqNetworkCreateError, error_message, e.backtrace
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good! But you could do this without two "raises" by assigning back to parsed_error :)

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for review, does it look better now?

@gildub
Copy link
Contributor

gildub commented Feb 4, 2018

LGTM. Just the Rubocop warning - I wasn't used to assign the value that way but it makes sense.

@miq-bot
Copy link
Member

miq-bot commented Feb 4, 2018

Checked commit alexander-demicev@a4deb4b with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 👍

@mansam mansam merged commit 80c6c78 into ManageIQ:master Feb 5, 2018
@aufi aufi added the bug label Feb 13, 2018
@aufi aufi added this to the Sprint 79 Ending Feb 12, 2018 milestone Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants