るりまサーチ

最速Rubyリファレンスマニュアル検索!
1542件ヒット [1-100件を表示] (0.038秒)
トップページ > クエリ:exception[x] > クエリ:exception[x]

別のキーワード

  1. _builtin exception
  2. thread abort_on_exception
  3. bigdecimal exception_nan
  4. bigdecimal exception_all

キーワード

検索結果

<< 1 2 3 ... > >>

Exception.exception(error_message = nil) -> Exception (54478.0)

例外オブジェクトを生成して返します。

...属性 Exception#message の値になり、デフォルトの例外ハンドラで表示されます。

//emlist[例][ruby]{
e = Exception.new("some message")
p e # => #<Exception: some message>
p e.message # => "some message"
//}

//emlist[例][ruby]{
e = Exception.exception("some mes...
...sage")
p e # => #<Exception: some message>
p e.message # => "some message"
//}...

Exception#exception(error_message) -> Exception (54462.0)

引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。

...lf を返します。引数を指定した場合 自身のコピー
を生成し 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
//}...

Exception#exception -> self (54262.0)

引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。

...lf を返します。引数を指定した場合 自身のコピー
を生成し 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
//}...

DRb::DRbUnknown#exception -> DRb::DRbUnknownError (36202.0)

マーシャリングされたオブジェクトが元のオブジェクトに変換できなかった、 ということを意味する例外オブジェクトを返します。

マーシャリングされたオブジェクトが元のオブジェクトに変換できなかった、
ということを意味する例外オブジェクトを返します。

この例外オブジェクトの DRb::DRbUnknownError#unknown を
呼び出すと、 self が返されます。

Exception.new(error_message = nil) -> Exception (24278.0)

例外オブジェクトを生成して返します。

...属性 Exception#message の値になり、デフォルトの例外ハンドラで表示されます。

//emlist[例][ruby]{
e = Exception.new("some message")
p e # => #<Exception: some message>
p e.message # => "some message"
//}

//emlist[例][ruby]{
e = Exception.exception("some mes...
...sage")
p e # => #<Exception: some message>
p e.message # => "some message"
//}...

絞り込み条件を変える

Exception2MessageMapper#def_exception(exception_name, message_format, superclass = StandardError) -> Class (18448.0)

exception_name という名前の例外クラスを定義します。

...
exception
_name という名前の例外クラスを定義します。

@param exception_name 定義する例外クラスの名前をシンボルで指定します。

@param message_format メッセージのフォーマット。

@param superclass 定義する例外のスーパークラスを指定...

Exception2MessageMapper.def_exception(klass, exception_name, message_format, superklass = StandardError) -> Class (18448.0)

exception_name という名前の例外クラスを定義します。

...
exception
_name という名前の例外クラスを定義します。

@param klass 一階層上となるクラス名を指定します。

@param exception_name 例外クラスの名前をシンボルで指定します。

@param message_format メッセージのフォーマットを指定しま...

Exception#cause -> Exception | nil (18202.0)

self の前の例外(self が rescue 節や ensure 節の中で発生した例外の場合、 その前に発生していた元々の例外)を返します。存在しない場合は nil を返し ます。

self の前の例外(self が rescue 節や ensure 節の中で発生した例外の場合、
その前に発生していた元々の例外)を返します。存在しない場合は nil を返し
ます。

//emlist[例][ruby]{
begin
begin
raise "inner"
rescue
raise "outer"
end
rescue
p $! # => #<RuntimeError: outer>
p $!.cause # => #<RuntimeError: inner>
end
//}

Exception.json_create(hash) -> Exception (18202.0)

JSON のオブジェクトから Ruby のオブジェクトを生成して返します。

JSON のオブジェクトから Ruby のオブジェクトを生成して返します。

@param hash 適切なキーを持つハッシュを指定します。

Exception#backtrace_locations -> [Thread::Backtrace::Location] (18092.0)

バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。

...バックトレース情報を返します。Exception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。

現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。

//emlist[例: test.rb][ruby]{
require...
...def get_exception
return begin
yield
rescue => e
e
end
end

e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "test.rb:9:in `get_exception'", "test.rb:15:in `<main>'"]
//}

@see Exception#backtr...

絞り込み条件を変える

<< 1 2 3 ... > >>