summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHemant Kumar <gethemant@gmail.com>2013-09-03 11:05:20 +0530
committerHemant Kumar <gethemant@gmail.com>2013-09-03 11:05:20 +0530
commit541aafe3f68c2052e1893a58c9e0332ec75129b9 (patch)
tree566a04317023bb017ffe1585a660a723695f814c
parente1ac0f34939855cb37bf037d550602ff5890f4a5 (diff)
downloadbundler-541aafe3f68c2052e1893a58c9e0332ec75129b9.tar.gz
Handle unhandled exceptions for thread workers and enque a wrapped exception
-rw-r--r--lib/bundler/parallel_workers/thread_worker.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/bundler/parallel_workers/thread_worker.rb b/lib/bundler/parallel_workers/thread_worker.rb
index 707e9f63b7..764b898e43 100644
--- a/lib/bundler/parallel_workers/thread_worker.rb
+++ b/lib/bundler/parallel_workers/thread_worker.rb
@@ -15,7 +15,11 @@ module Bundler
loop do
obj = @request_queue.deq
break if obj.equal? POISON
- @response_queue.enq func.call(obj)
+ begin
+ @response_queue.enq func.call(obj)
+ rescue Exception => e
+ @response_queue.enq(WrappedException.new(e))
+ end
end
end
end