4件ヒット
[1-4件を表示]
(0.122秒)
ライブラリ
- ビルトイン (4)
クラス
- Exception (2)
- NameError (1)
- UncaughtThrowError (1)
検索結果
先頭4件
-
NameError
# to _ s -> String (54343.0) -
例外オブジェクトを文字列に変換して返します。
例外オブジェクトを文字列に変換して返します。
例:
begin
foobar
rescue NameError => err
p err # => #<NameError: undefined local variable or method `foobar' for main:Object>
p err.to_s # => "undefined local variable or method `foobar' for main:Object"
end -
UncaughtThrowError
# to _ s -> String (54343.0) -
self を tag を含む文字列表現にして返します。
self を tag を含む文字列表現にして返します。
//emlist[例][ruby]{
def do_complicated_things
throw :uncaught_label
end
begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.to_s # => "uncaught throw :uncaught_label"
end
//} -
Exception
# to _ s -> String (45325.0) -
エラーメッセージをあらわす文字列を返します。
エラーメッセージをあらわす文字列を返します。
//emlist[例][ruby]{
begin
1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end
//} -
Exception
# message -> String (25.0) -
エラーメッセージをあらわす文字列を返します。
エラーメッセージをあらわす文字列を返します。
//emlist[例][ruby]{
begin
1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end
//}