app/models/manageiq/providers/ovirt/infra_manager/vm_or_template_shared/scanning.rb
Avoid rescuing the Exception
class. Perhaps you meant to rescue StandardError
? Open
Open
rescue Exception => err
msg = "#{log_header}: Connection to [#{ems_display_text}] failed for VM:[#{@vm_cfg_file}] with error [#{err}] after [#{Time.now - st}] seconds"
$log.error msg
raise
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
Checks for rescue
blocks targeting the Exception class.
Example:
# bad
begin
do_something
rescue Exception
handle_exception
end
Example:
# good
begin
do_something
rescue ArgumentError
handle_exception
end