A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.ruby-lang.org/en/master/UncaughtThrowError.html below:

class UncaughtThrowError - Documentation for Ruby 3.5

class UncaughtThrowError

Raised when throw is called with a tag which does not have corresponding catch block.

throw "foo", "bar"

raises the exception:

UncaughtThrowError: uncaught throw "foo"
Public Class Methods

Source

static VALUE
uncaught_throw_init(int argc, const VALUE *argv, VALUE exc)
{
    rb_check_arity(argc, 2, UNLIMITED_ARGUMENTS);
    rb_call_super(argc - 2, argv + 2);
    rb_ivar_set(exc, id_tag, argv[0]);
    rb_ivar_set(exc, id_value, argv[1]);
    return exc;
}

Document-class: UncaughtThrowError

Raised when throw is called with a tag which does not have corresponding catch block.

throw "foo", "bar"

raises the exception:

UncaughtThrowError: uncaught throw "foo"
Public Instance Methods

Source

static VALUE
uncaught_throw_tag(VALUE exc)
{
    return rb_ivar_get(exc, id_tag);
}

Return the tag object which was called for.

Source

static VALUE
uncaught_throw_to_s(VALUE exc)
{
    VALUE mesg = rb_attr_get(exc, id_mesg);
    VALUE tag = uncaught_throw_tag(exc);
    return rb_str_format(1, &tag, mesg);
}

Returns formatted message with the inspected tag.

Source

static VALUE
uncaught_throw_value(VALUE exc)
{
    return rb_ivar_get(exc, id_value);
}

Return the return value which was called for.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4