Skip to content

Commit

Permalink
Suppress Lint/RescueException
Browse files Browse the repository at this point in the history
  • Loading branch information
ohbarye committed May 6, 2024
1 parent 08f94f2 commit b0ff10a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/pbt/check/runner_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ def run_it_in_sequential(property, runner)
begin
property.run(val)
runner.handle_result(c)
rescue Exception => e # Catch all exceptions including RSpec's ExpectationNotMet (It inherits Exception).
# Catch all exceptions including RSpec's ExpectationNotMet (It inherits Exception).
rescue Exception => e # standard:disable Lint/RescueException:
c.exception = e
runner.handle_result(c)
break # Ignore the rest of the cases. Just pick up the first failure.
Expand Down Expand Up @@ -162,7 +163,8 @@ def run_it_in_threads(property, runner)
Parallel.map_with_index(runner, in_threads: Parallel.processor_count) do |val, index|
Case.new(val:, index:).tap do |c|
property.run(val)
rescue Exception => e # Catch all exceptions including RSpec's ExpectationNotMet (It inherits Exception).
# Catch all exceptions including RSpec's ExpectationNotMet (It inherits Exception).
rescue Exception => e # standard:disable Lint/RescueException:
c.exception = e
# It's possible to break this loop here by raising `Parallel::Break`.
# But if it raises, we cannot fetch all cases' result. So this loop continues until the end.
Expand All @@ -183,7 +185,8 @@ def run_it_in_processes(property, runner)
Parallel.map_with_index(runner, in_processes: Parallel.processor_count) do |val, index|
Case.new(val:, index:).tap do |c|
property.run(val)
rescue Exception => e # Catch all exceptions including RSpec's ExpectationNotMet (It inherits Exception).
# Catch all exceptions including RSpec's ExpectationNotMet (It inherits Exception).
rescue Exception => e # standard:disable Lint/RescueException:
c.exception = e
# It's possible to break this loop here by raising `Parallel::Break`.
# But if it raises, we cannot fetch all cases' result. So this loop continues until the end.
Expand Down

0 comments on commit b0ff10a

Please sign in to comment.