るりまサーチ

最速Rubyリファレンスマニュアル検索!
116件ヒット [101-116件を表示] (0.103秒)
トップページ > クエリ:Ruby[x] > クエリ:ruby[x] > 種類:インスタンスメソッド[x] > クエリ:r[x] > クエリ:exception[x] > クラス:Exception[x]

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

キーワード

検索結果

<< < 1 2 >>

Exception#to_json(*args) -> String (9114.0)

自身を JSON 形式の文字列に変換して返します。

...erator::GeneratorMethods::Hash#to_json を呼び出しています。

@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。

//emlist[例][ruby]{
r
equire "json/add/core"

begin
0/0
r
escue => e
e.to_json # => "{\"json_class\":\"ZeroDivisionError\...
...",\"m\":\"divided by 0\",\"b\":[\"/path/to/test.rb:4:in `/'\",\"/path/to/test.rb:4:in `<main>'\"]}"
end
//}

@see JSON::Generator::GeneratorMethods::Hash#to_json...

Exception#to_s -> String (9114.0)

エラーメッセージをあらわす文字列を返します。

...エラーメッセージをあらわす文字列を返します。

//emlist[例][ruby]{
begin
1 + nil
r
escue => e
p e.message #=> "nil can't be coerced into Fixnum"
end
//}...
<< < 1 2 >>