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

Display api error to users for v2.1 if they exist #153

Merged
merged 2 commits into from
Mar 31, 2015

Conversation

dcastellanos-r7
Copy link
Contributor

Possible way to display v2.1 api errors to users.

@@ -158,14 +158,28 @@ def request(nsc, request, timeout = nil)
raise Nexpose::AuthenticationFailed.new(response)
else
req_type = request.class.name.split('::').last.upcase
raise Nexpose::APIError.new(response, "#{req_type} request to #{request.path} failed. #{request.body}", response.code)
raise Nexpose::APIError.new(response, "#{req_type} request to #{request.path} failed. #{get_reason(request, response)}", response.code)

Choose a reason for hiding this comment

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

Line is too long. [145/120]

Copy link
Contributor

Choose a reason for hiding this comment

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

How about adding a local variable to remove the call internal to the string's interpolation?

@gperez-r7
Copy link
Contributor

@dcastellanos-r7, can you provide examples of what this output looks like?

#
# @param [HTTPRequest] request
def get_request_api_version(request)
matches = request.path.match(API_PATTERN)

Choose a reason for hiding this comment

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

Use 2 (not 4) spaces for indentation.

@gperez-r7
Copy link
Contributor

That output looks fine to me.

gperez-r7 added a commit that referenced this pull request Mar 31, 2015
Display api error to users for v2.1 if they exist
@gperez-r7 gperez-r7 merged commit a0c3f2d into staging/v1 Mar 31, 2015
@gperez-r7 gperez-r7 deleted the display-api-errors branch March 31, 2015 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants