165件ヒット
[1-100件を表示]
(0.040秒)
ライブラリ
- ビルトイン (114)
- json (12)
-
json
/ add / exception (12) -
minitest
/ unit (3) - rexml (12)
- stringio (12)
クラス
-
ARGF
. class (10) - Exception (80)
- IO (24)
-
JSON
:: State (12) -
MiniTest
:: Unit (2) -
REXML
:: ParseException (12) - SignalException (12)
- StringIO (12)
モジュール
キーワード
- backtrace (12)
-
exception
_ details (1) - generate (12)
- inspect (12)
- location (1)
- puke (1)
-
read
_ nonblock (34) -
set
_ backtrace (12) - signm (12)
-
to
_ json (12) -
to
_ s (24) -
write
_ nonblock (12)
検索結果
先頭5件
-
Exception
# set _ backtrace(errinfo) -> nil | String | [String] (9215.0) -
バックトレース情報に errinfo を設定し、設定されたバックトレース 情報を返します。
...ックトレース情報に errinfo を設定し、設定されたバックトレース
情報を返します。
@param errinfo nil、String あるいは String の配列のいずれかを指定します。
//emlist[例][ruby]{
begin
begin
raise "inner"
rescue
raise "outer"
end
rescu... -
Exception
# full _ message(highlight: true , order: :bottom) -> String (9120.0) -
例外の整形された文字列を返します。
...値は Exception.to_tty? の返り値と同じです。
@param order :top か :bottom で指定する必要があります。
バックトレースの一番奥がエラーメッセージの上(top)か下(bottom)かを指定します。
デフォルト値は Exception.to_tt......e[1m)\n\e[m"
$stderr = $stdout
p e.full_message # => "test.rb:2:in `<main>': test (RuntimeError)\n"
$stderr = STDERR
p e.full_message # => "\e[1mTraceback \e[m(most recent call last):\ntest.rb:2:in `<main>': \e[1mtest (\e[4;1mRuntimeError\e[m\e[1m)\n\e[m"
end
//}
@see Exception.to_tty?... -
Exception
# backtrace -> [String] (9114.0) -
バックトレース情報を返します。
...)
* "#{sourcefile}:#{sourceline}"
(トップレベルの場合)
という形式の String の配列です。
//emlist[例][ruby]{
def methd
raise
end
begin
methd
rescue => e
p e.backtrace
end
#=> ["filename.rb:2:in `methd'", "filename.rb:6"]
//}
@see Exception#backtrace_locations... -
Exception
# inspect -> String (9114.0) -
self のクラス名と message を文字列にして返します。
...self のクラス名と message を文字列にして返します。
//emlist[例][ruby]{
begin
raise "exception"
rescue
p $!.inspect # => "#<RuntimeError: exception>"
end
//}... -
Exception
# message -> String (9103.0) -
エラーメッセージをあらわす文字列を返します。
エラーメッセージをあらわす文字列を返します。
//emlist[例][ruby]{
begin
1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end
//} -
Exception
# to _ s -> String (9103.0) -
エラーメッセージをあらわす文字列を返します。
エラーメッセージをあらわす文字列を返します。
//emlist[例][ruby]{
begin
1 + nil
rescue => e
p e.message #=> "nil can't be coerced into Fixnum"
end
//} -
Exception
# to _ json(*args) -> String (9102.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。
//emlist[例][ruby]{
require "json/add/core"
begin
0/0
rescue => e
e.to_json # => "{\"json_class\":\"ZeroDivis... -
MiniTest
:: Assertions # exception _ details(exception , message) -> String (6310.0) -
与えられた例外の詳細を文字列として返します。
...与えられた例外の詳細を文字列として返します。
@param exception 例外を指定します。
@param message メッセージを指定します。... -
StringIO
# read _ nonblock(maxlen , outbuf = nil , exception: true) -> String | nil (3225.0) -
StringIO#readに似ていますが、 exception オプションに false を指定すると EOFError を発生させず nil を返します。
...
StringIO#readに似ていますが、 exception オプションに false を指定すると EOFError を発生させず nil を返します。
@param len 読み込みたい長さを整数で指定します。StringIO#read と同じです。
@param outbuf 読み込んだ文字列を出力するバ......いは縮小)されたあと、
実際に読み込んだデータのサイズになります。IO#read と同じです。
@param exception false を指定した場合、既に EOF に達していれば
EOFError の代わりに nil を返します。
@raise EOFError... -
REXML
:: ParseException # to _ s -> String (3102.0) -
例外情報を文字列化して返します。
例外情報を文字列化して返します。