File: exception_raised_in_process.rb

package info (click to toggle)
ruby-parallel 1.27.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 476 kB
  • sloc: ruby: 1,998; makefile: 4
file content (12 lines) | stat: -rw-r--r-- 328 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
# frozen_string_literal: true
require './spec/cases/helper'

begin
  Parallel.each([1]) { raise StandardError } # rubocop:disable Lint/UnreachableLoop
rescue Parallel::DeadWorker
  puts "No, DEAD worker found"
rescue Exception # rubocop:disable Lint/RescueException
  puts "Yep, rescued the exception"
else
  puts "WHOOOPS"
end