Skip to content

Commit

Permalink
Merge pull request #576 from aufi/fix_error_handling_outside_openstac…
Browse files Browse the repository at this point in the history
…k_provider

Update Network Refresh error logging for not-OpenStack provider
  • Loading branch information
agrare authored Apr 3, 2020
2 parents 44a40c9 + e2eb354 commit fc1ddbe
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,22 @@ def safe_call
yield
rescue Excon::Errors::Forbidden => err
# It can happen user doesn't have rights to read some tenant, in that case log warning but continue refresh
_log.warn "Forbidden response code returned in provider: #{@os_handle.address}. Message=#{err.message}"
_log.warn "Forbidden response code returned in provider: #{@manager&.hostname}. Message=#{err.message}"
_log.warn err.backtrace.join("\n")
nil
rescue Excon::Errors::Unauthorized => err
# It can happen user doesn't have rights to read some tenant, in that case log warning but continue refresh
_log.warn "Unauthorized response code returned in provider: #{@os_handle.address}. Message=#{err.message}"
_log.warn "Unauthorized response code returned in provider: #{@manager&.hostname}. Message=#{err.message}"
_log.warn err.backtrace.join("\n")
nil
rescue Excon::Errors::NotFound, Fog::Errors::NotFound => err
# It can happen that some data do not exist anymore,, in that case log warning but continue refresh
_log.warn "Not Found response code returned in provider: #{@os_handle.address}. Message=#{err.message}"
_log.warn "Not Found response code returned in provider: #{@manager&.hostname}. Message=#{err.message}"
_log.warn err.backtrace.join("\n")
nil
rescue Excon::Errors::BadRequest => err
# This can happen if stack resources are missing, among other reasons. In such a case log a warning but continue the refresh.
_log.warn "Bad Request response code returned in provider: #{@os_handle.address}. Message=#{err.message}"
_log.warn "Bad Request response code returned in provider: #{@manager&.hostname}. Message=#{err.message}"
_log.warn err.backtrace.join("\n")
nil
end
Expand Down

0 comments on commit fc1ddbe

Please sign in to comment.