Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions stdlib/builtin/errors.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,8 @@ end
#
# UncaughtThrowError: uncaught throw "foo"
class UncaughtThrowError < ArgumentError
def tag: () -> untyped
def value: () -> untyped
end

# Raised when attempting to divide an integer by 0.
Expand Down
22 changes: 22 additions & 0 deletions test/stdlib/UncaughtThrowError_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require_relative "test_helper"

class UncaughtThrowErrorTest < StdlibTest
target UncaughtThrowError
using hook.refinement

def test_tag
begin
throw :a
rescue UncaughtThrowError => error
error.tag
end
end

def test_value
begin
throw :a
rescue UncaughtThrowError => error
error.value
end
end
end