-
-
Notifications
You must be signed in to change notification settings - Fork 84
[CF] improve logging and error handling #434
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
base: fog-arm-cf
Are you sure you want to change the base?
Conversation
add catch all to log all errors
| rescue Azure::Core::Http::HTTPError => ex | ||
| Fog::Logger.warning "Azure error #{e.inspect}, correlation id: #{correlation_id}." | ||
| raise_azure_exception(ex, msg) | ||
| rescue => e |
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.
Style/RescueStandardError: Avoid rescuing without specifying an error class.
| my_options[:request_id] = SecureRandom.uuid | ||
|
|
||
| correlation_id = SecureRandom.uuid | ||
| if my_options[:fog_correlation_id] != nil |
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.
Style/NonNilCheck: Prefer !expression.nil? over expression != nil.
| my_options = options.clone | ||
|
|
||
| correlation_id = SecureRandom.uuid | ||
| if my_options[:fog_correlation_id] != nil |
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.
Style/NonNilCheck: Prefer !expression.nil? over expression != nil.
| return true if ex.message.include?('(404)') | ||
| Fog::Logger.warning "Azure error #{e.inspect}, correlation id: #{correlation_id}." | ||
| raise_azure_exception(ex, msg) | ||
| rescue => e |
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.
Style/RescueStandardError: Avoid rescuing without specifying an error class.
| msg = "Deleting blob: #{blob_name} in container #{container_name}. options: #{my_options}" | ||
|
|
||
| correlation_id = SecureRandom.uuid | ||
| if my_options[:fog_correlation_id] != nil |
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.
Style/NonNilCheck: Prefer !expression.nil? over expression != nil.
| rescue Azure::Core::Http::HTTPError => ex | ||
| Fog::Logger.warning "Azure error #{e.inspect}, correlation id: #{correlation_id}." | ||
| raise_azure_exception(ex, msg) | ||
| rescue => e |
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.
Style/RescueStandardError: Avoid rescuing without specifying an error class.
| my_options[:request_id] = SecureRandom.uuid | ||
|
|
||
| correlation_id = SecureRandom.uuid | ||
| if my_options[:fog_correlation_id] != nil |
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.
Style/NonNilCheck: Prefer !expression.nil? over expression != nil.
| rescue Azure::Core::Http::HTTPError => ex | ||
| Fog::Logger.warning "Azure error #{e.inspect}, correlation id: #{correlation_id}." | ||
| raise_azure_exception(ex, msg) | ||
| rescue => e |
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.
Style/RescueStandardError: Avoid rescuing without specifying an error class.
| msg = "commit_blob_blocks: Complete uploading #{blob_name} to the container #{container_name}. options: #{my_options}" | ||
|
|
||
| correlation_id = SecureRandom.uuid | ||
| if my_options[:fog_correlation_id] != nil |
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.
Style/NonNilCheck: Prefer !expression.nil? over expression != nil.
| my_options = options.clone | ||
| my_options[:request_id] = SecureRandom.uuid | ||
| msg = "commit_blob_blocks: Complete uploading #{blob_name} to the container #{container_name}. options: #{my_options}" | ||
|
|
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.
Layout/TrailingWhitespace: Trailing whitespace detected.
| my_options[:request_id] = SecureRandom.uuid | ||
|
|
||
| correlation_id = SecureRandom.uuid | ||
| if !my_options[:fog_correlation_id].nil? |
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.
Style/NegatedIf: Favor unless over if for negative conditions.
| msg = "Deleting blob: #{blob_name} in container #{container_name}. options: #{my_options}" | ||
|
|
||
| correlation_id = SecureRandom.uuid | ||
| if !my_options[:fog_correlation_id].nil? |
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.
Style/NegatedIf: Favor unless over if for negative conditions.
| my_options[:request_id] = SecureRandom.uuid | ||
|
|
||
| correlation_id = SecureRandom.uuid | ||
| if !my_options[:fog_correlation_id].nil? |
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.
Style/NegatedIf: Favor unless over if for negative conditions.
| msg = "commit_blob_blocks: Complete uploading #{blob_name} to the container #{container_name}. options: #{my_options}" | ||
|
|
||
| correlation_id = SecureRandom.uuid | ||
| if !my_options[:fog_correlation_id].nil? |
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.
Style/NegatedIf: Favor unless over if for negative conditions.
Improvements: