From f45e0d537ff0a902f3122eac47b809f3c6098dc4 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 16 Nov 2014 10:11:08 +0000 Subject: [PATCH] timeout.rb: use UncaughtThrowError * lib/timeout.rb (Timeout::ExitException#exception): rescue UncaughtThrowError which is specific for throw, instead of ArgumentError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ lib/timeout.rb | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 59682c38d8..87cad170aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Nov 16 19:11:04 2014 Nobuyoshi Nakada + + * lib/timeout.rb (Timeout::ExitException#exception): rescue + UncaughtThrowError which is specific for throw, instead of + ArgumentError. + Sun Nov 16 18:22:18 2014 Eric Wong * tool/update-deps: warning to disable ccache diff --git a/lib/timeout.rb b/lib/timeout.rb index d805dce2a3..cf23fb5fb6 100644 --- a/lib/timeout.rb +++ b/lib/timeout.rb @@ -40,8 +40,7 @@ module Timeout bt = caller begin throw(self, bt) - rescue ArgumentError => e - raise unless e.message.start_with?("uncaught throw") + rescue UncaughtThrowError raise Error, message, backtrace end end