86件ヒット
[1-86件を表示]
(0.032秒)
クラス
- Exception (11)
- LoadError (11)
- SystemExit (11)
- Thread (11)
- UncaughtThrowError (20)
モジュール
- Kernel (22)
検索結果
先頭5件
-
Kernel
# with _ werror(opt , opts = nil) {|opt , opts| . . . } -> object (27101.0) -
@todo 内部用?
@todo 内部用?
???
@param opt ????
@param opts ????
@return ブロックを評価した結果を返します。 -
Kernel
# with _ werror(opt , opts = nil) {|opt| . . . } -> object (27101.0) -
@todo 内部用?
@todo 内部用?
???
@param opt ????
@param opts ????
@return ブロックを評価した結果を返します。 -
LoadError
# path -> String | nil (3033.0) -
Kernel.#require や Kernel.#load に失敗したパスを返します。
...
Kernel.#require や Kernel.#load に失敗したパスを返します。
begin
require 'this/file/does/not/exist'
rescue LoadError => e
e.path # => 'this/file/does/not/exist'
end
パスが定まらない場合は nil を返します。... -
UncaughtThrowError
# tag -> object (3017.0) -
Kernel.#throw に指定した tag を返します。
...
Kernel.#throw に指定した tag を返します。
//emlist[例:][ruby]{
def do_complicated_things
throw :uncaught_label
end
begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.tag # => ":uncaught_label"
end
//}... -
UncaughtThrowError
# value -> object (3017.0) -
Kernel.#throw に指定した value を返します。
...
Kernel.#throw に指定した value を返します。
//emlist[例][ruby]{
def do_complicated_things
throw :uncaught_label, "uncaught_value"
end
begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.value # => "uncaught_value"
end
//}... -
Thread
# raise(error _ type , message , traceback) -> () (119.0) -
自身が表すスレッドで強制的に例外を発生させます。
...身が表すスレッドで強制的に例外を発生させます。
@param error_type Kernel.#raise を参照してください。
@param message Kernel.#raise を参照してください。
@param traceback Kernel.#raise を参照してください。
Thread.new {
sleep 1
Thread.mai......n.raise "foobar"
}
begin
sleep
rescue
p $!, $@
end
=> #<RuntimeError: foobar>
["-:3"]... -
Exception
# exception(error _ message) -> Exception (107.0) -
引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。
...た場合 自身のコピー
を生成し Exception#message 属性を error_message にして返します。
Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。
@param error_message エラーメッセージを表す文字列を指定しま......す。
//emlist[例][ruby]{
begin
# ... # 何か処理
rescue => e
raise e.exception("an error occurs during hogehoge process") # 詳しいエラーメッセージ
end
//}... -
SystemExit
# status -> Integer (31.0) -
例外オブジェクトに保存された終了ステータスを返します。
...します。
終了ステータスは Kernel.#exit や SystemExit.new などで設定されます。
例:
begin
exit 1
rescue SystemExit => err
p err.status # => 1
end
begin
raise SystemExit.new(1, "dummy exit")
rescue SystemExit => err
p err.status # => 1
end...