Skip to content

Commit

Permalink
created UncaughtThrowError which is raised by throw when not catched
Browse files Browse the repository at this point in the history
  • Loading branch information
tak1n committed May 25, 2015
1 parent 1736d40 commit fdf295c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions kernel/common/exception.rb
Expand Up @@ -213,6 +213,9 @@ def to_s
end
end

class UncaughtThrowError < StandardError
end

class IndexError < StandardError
end

Expand Down
2 changes: 1 addition & 1 deletion kernel/common/throw_catch.rb
Expand Up @@ -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
Expand Down

0 comments on commit fdf295c

Please sign in to comment.