From 8007abded8de355650af67d04bffc8f811af409d Mon Sep 17 00:00:00 2001 From: Zachary Patten Date: Mon, 27 Feb 2017 13:01:25 -0800 Subject: [PATCH] handle exceptions when the child writer goes wonky --- lib/ztk/parallel.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/ztk/parallel.rb b/lib/ztk/parallel.rb index 645d4d865..2a7aed9ae 100644 --- a/lib/ztk/parallel.rb +++ b/lib/ztk/parallel.rb @@ -149,7 +149,11 @@ def process(&block) if !data.nil? config.ui.logger.debug { "write(#{data.inspect})" } - child_writer.write(Base64.encode64(Marshal.dump(data))) + begin + child_writer.write(Base64.encode64(Marshal.dump(data))) + rescue Exception => e + config.ui.logger.warn { "Exception while writing data to child_writer! - #{e.inspect}" } + end end child_reader.close