Skip to content

Commit

Permalink
Added Null Check for Path Params Attribute in Azure Exception (#423)
Browse files Browse the repository at this point in the history
Summary: When printing READ and WRITE limits for Azure API requests, an exception occurs when trying to access Subscription ID key inside the path_params hash that can be null at times.
A check has been added to first ensure that the hash is not null before extracting the Subscription ID from it.
  • Loading branch information
maham-nazir-confiz authored Nov 18, 2019
1 parent 582fd3d commit fee87f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fog/azurerm/custom_fog_errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def initialize(message, azure_exception)

def print_subscription_limits_information
request_method = @request.method
subscription_id = @request.path_params['subscriptionId']
subscription_id = @request.path_params['subscriptionId'] unless @request.path_params.nil?

This comment has been minimized.

Copy link
@oleksii-tokarchuk

limit_value = remaining_subscription_request_limits(@response)

Expand Down

0 comments on commit fee87f2

Please sign in to comment.