aboutsummaryrefslogtreecommitdiffstats
path: root/lib/timeout.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-16 10:11:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-16 10:11:08 +0000
commitf45e0d537ff0a902f3122eac47b809f3c6098dc4 (patch)
treea561a92531dd710b18fc2a66b628369a9f8745b3 /lib/timeout.rb
parent5b85fbd95b68704e62590ca1c2dde5d815205f65 (diff)
downloadruby-f45e0d537ff0a902f3122eac47b809f3c6098dc4.tar.gz
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
Diffstat (limited to 'lib/timeout.rb')
-rw-r--r--lib/timeout.rb3
1 files changed, 1 insertions, 2 deletions
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