Method: Inspec::Resources::AzureResourceBase#catch_azure_errors

Defined in:
lib/resources/azure/azure_backend.rb

#catch_azure_errorsObject



47
48
49
50
51
52
53
54
55
# File 'lib/resources/azure/azure_backend.rb', line 47

def catch_azure_errors
  yield
rescue MsRestAzure::AzureOperationError => e
  # e.message is actually a massive stringified JSON, which might be useful in the future.
  # You want error_message here.
  fail_resource e.error_message
  @failed_resource = true
  nil
end