Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created UncaughtThrowError which is raised by throw when not catched
Browse files Browse the repository at this point in the history
tak1n committed May 25, 2015
1 parent 1736d40 commit fdf295c
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions kernel/common/exception.rb
Original file line number Diff line number Diff line change
@@ -213,6 +213,9 @@ def to_s
end
end

class UncaughtThrowError < StandardError
end

class IndexError < StandardError
end

2 changes: 1 addition & 1 deletion kernel/common/throw_catch.rb
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ def catch(obj = Object.new, &block)

def throw(obj, value=nil)
unless Rubinius::ThrownValue.available? obj
raise ArgumentError, "uncaught throw #{obj.inspect}"
raise UncaughtThrowError, "uncaught throw #{obj.inspect}"
end

Rubinius.throw obj, value

0 comments on commit fdf295c

Please sign in to comment.