Skip to content

Commit

Permalink
remove overzealous error handler
Browse files Browse the repository at this point in the history
  • Loading branch information
jmartin-tech authored and sempervictus committed Apr 12, 2023
1 parent a4694c6 commit 9930efd
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions modules/auxiliary/cloud/aws/enum_ec2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,6 @@ def initialize(info = {})
)
end

def handle_aws_errors(err)
if err.class.module_parents.include?(Aws)
fail_with(Failure::UnexpectedReply, err.message)
else
raise err
end
end

def enumerate_regions
return [datastore['REGION']] if datastore['REGION']

Expand Down Expand Up @@ -147,7 +139,7 @@ def run
rescue Seahorse::Client::NetworkingError => e
print_error e.message
print_error 'Confirm region name (eg. us-west-2) is valid or blank before retrying'
rescue ::Exception => e
handle_aws_errors(e)
rescue Aws::EC2::Errors::ServiceError => e
fail_with(Failure::UnexpectedReply, e.message)
end
end

0 comments on commit 9930efd

Please sign in to comment.