Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fdf295c

Browse files
committedMay 25, 2015
created UncaughtThrowError which is raised by throw when not catched
1 parent 1736d40 commit fdf295c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
 

Diff for: ‎kernel/common/exception.rb

+3
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ def to_s
213213
end
214214
end
215215

216+
class UncaughtThrowError < StandardError
217+
end
218+
216219
class IndexError < StandardError
217220
end
218221

Diff for: ‎kernel/common/throw_catch.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def catch(obj = Object.new, &block)
3434

3535
def throw(obj, value=nil)
3636
unless Rubinius::ThrownValue.available? obj
37-
raise ArgumentError, "uncaught throw #{obj.inspect}"
37+
raise UncaughtThrowError, "uncaught throw #{obj.inspect}"
3838
end
3939

4040
Rubinius.throw obj, value

0 commit comments

Comments
 (0)
Please sign in to comment.