-
Notifications
You must be signed in to change notification settings - Fork 103
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
Conversation
@@ -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) |
There was a problem hiding this comment.
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]
There was a problem hiding this comment.
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?
@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) |
There was a problem hiding this comment.
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.
That output looks fine to me. |
Display api error to users for v2.1 if they exist
Possible way to display v2.1 api errors to users.