Skip to content

Commit e1835ff

Browse files
committed
(maint) remove rescue Exception
Remove `rescue Exception` from parser since this is just responsible of formating the output. The extra handling should be done in Facter::Core::Execution, if needed.
1 parent bdd588a commit e1835ff

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

.rubocop.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ require:
1313
Layout/LineLength:
1414
Max: 120
1515

16-
Lint/RescueException:
17-
Exclude:
18-
- 'lib/facter/custom_facts/util/parser.rb'
19-
2016
Lint/RaiseException:
2117
Enabled: true
2218

lib/facter/custom_facts/util/parser.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def content
5656
# wrapper.
5757
def results
5858
parse_results
59-
rescue Exception => e
59+
rescue StandardError => e
6060
Facter.log_exception(e, "Failed to handle #{filename} as #{self.class} facts: #{e.message}")
6161
nil
6262
end
@@ -69,7 +69,7 @@ def parse_executable_output(output)
6969
res = nil
7070
begin
7171
res = YAML.safe_load(output, [Symbol, Time])
72-
rescue Exception => e
72+
rescue StandardError => e
7373
Facter.debug("Could not parse executable fact output as YAML or JSON (#{e.message})")
7474
end
7575
res = KeyValuePairOutputFormat.parse output unless res.is_a?(Hash)

0 commit comments

Comments
 (0)