Skip to content

Commit

Permalink
(maint) remove rescue Exception
Browse files Browse the repository at this point in the history
Since ths methods is just doing a YAML.safe_load
there is no point in rescueing `Exception`.
  • Loading branch information
gimmy committed Jul 16, 2020
1 parent bdd588a commit 5fc2f9c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ require:
Layout/LineLength:
Max: 120

Lint/RescueException:
Exclude:
- 'lib/facter/custom_facts/util/parser.rb'

Lint/RaiseException:
Enabled: true

Expand Down
2 changes: 1 addition & 1 deletion lib/facter/custom_facts/util/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def parse_executable_output(output)
res = nil
begin
res = YAML.safe_load(output, [Symbol, Time])
rescue Exception => e
rescue StandardError => e
Facter.debug("Could not parse executable fact output as YAML or JSON (#{e.message})")
end
res = KeyValuePairOutputFormat.parse output unless res.is_a?(Hash)
Expand Down

0 comments on commit 5fc2f9c

Please sign in to comment.