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

Resource group faraday #377

Open
wants to merge 6 commits into
base: rest-api-migration
Choose a base branch
from
Open

Resource group faraday #377

wants to merge 6 commits into from

Conversation

bilal-naeem-confiz
Copy link
Contributor

Faraday Network Adapter with Custom Exception

url,
@token
)
rescue => e

Choose a reason for hiding this comment

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

Avoid rescuing without specifying an error class.

end

def create_resource_group_body(location, tags)
parameters = {

Choose a reason for hiding this comment

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

Useless assignment to variable - parameters.

resource_group
end

def create_resource_group_body(location, tags)

Choose a reason for hiding this comment

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

Unused method argument - tags. If it's necessary, use _ or _tags as an argument name to indicate that it won't be used.

@token,
body
)
rescue => e

Choose a reason for hiding this comment

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

Avoid rescuing without specifying an error class.

rescue MsRestAzure::AzureOperationError => e
raise_azure_exception(e, msg)
response = Fog::AzureRM::NetworkAdapter.get(url, @token)
rescue => e

Choose a reason for hiding this comment

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

Avoid rescuing without specifying an error class.

send_request(url, token, nil, DELETE_METHOD)
end

private

Choose a reason for hiding this comment

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

Useless private access modifier.

end
end
end
end

Choose a reason for hiding this comment

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

Final newline missing.


def to_s
exception = {}

Choose a reason for hiding this comment

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

Trailing whitespace detected.

STATUS_CODES = {
success: [200, 201, 202, 203, 204],
failure: [400, 401, 402, 403, 404, 500, 501, 502, 503]
}

Choose a reason for hiding this comment

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

Final newline missing.

SUCCESS = 'success'.freeze
FAILURE = 'failure'.freeze

STATUS_CODES = {

Choose a reason for hiding this comment

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

Freeze mutable objects assigned to constants.

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.

2 participants