るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.041秒)
トップページ > バージョン:2.3.0[x] > クエリ:error_message[x] > ライブラリ:ビルトイン[x]

別のキーワード

  1. logger error
  2. openssl error
  3. logger error?
  4. getoptlong error
  5. openssl error_string

キーワード

検索結果

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

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

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

Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。

@param error_message エラーメッセージを表す文字列を指定します。

//emlist[例][ruby]{
begin
# ... # 何か処理
rescue => e
raise e.exception("an error occurs during hogeho...

SystemCallError.new(error_message) -> SystemCallError (334.0)

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

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

@param error_message エラーメッセージを表す文字列

例:

p SystemCallError.new("message")
# => #<SystemCallError: unknown error - message>

SystemCallError.new(error_message, errno) -> SystemCallError (334.0)

整数 errno に対応する Errno::EXXX オブジェクトを生成して返します。

整数 errno に対応する Errno::EXXX オブジェクトを生成して返します。

整数 errno をシステムコールで発生したエラーの原因を示すコードであると解釈し、
対応する例外クラスのインスタンスを生成して返します。

生成されるオブジェクトは SystemCallError の直接のインスタンスではなく、サブクラスのインスタンスです。
それらのサブクラスは Errno モジュール内に定義されています。
対応するサブクラスが存在しないコードを与えた場合には、 SystemCallError の直接のインスタンスが生成されます。

エラーコードの取り得る値および意味はシステムに依存し...

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

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

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

@param error_message エラーメッセージを表す文字列を指定します。このメッセージは
属性 Exception#message の値になり、デフォルトの例外ハンドラで表示されます。

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

//emlist[例][ruby]{
e = E...

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

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

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

@param error_message エラーメッセージを表す文字列を指定します。このメッセージは
属性 Exception#message の値になり、デフォルトの例外ハンドラで表示されます。

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

//emlist[例][ruby]{
e = E...

絞り込み条件を変える

Errno::EXXX.new(error_message) -> Errno::EXXX (328.0)

Errno::EXXX オブジェクトを生成して返します。

Errno::EXXX オブジェクトを生成して返します。

@param error_message エラーメッセージを表す文字列

p Errno::ENOENT.new
# => #<Errno::ENOENT: No such file or directory>
p Errno::ENOENT.new('message')
# => #<Errno::ENOENT: No such file or directory - message>

NameError.new(error_message = "", name = nil) -> NameError (328.0)

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

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

@param error_message エラーメッセージを表す文字列です

@param name 未定義だったシンボルです


例:

err = NameError.new("message", "foo")
p err # => #<NameError: message>
p err.name # => "foo"

NoMethodError.new(error_message = "", name = nil, args = nil) -> NoMethodError (328.0)

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

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

@param error_message エラーメッセージを表す文字列です

@param name 未定義だったシンボルです

@param args メソッド呼び出しに使われた引数です


例:

nom = NoMethodError.new("message", "foo", [1,2,3])
p nom.name
p nom.args

# => "foo"
[1, 2, 3]

SystemExit.new(status = 0, error_message = "") -> SystemExit (328.0)

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

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

@param status 終了ステータスを整数で指定します。

@param error_message エラーメッセージを文字列で指定します。

例:

ex = SystemExit.new(1)
p ex.status # => 1

Exception#exception -> self (76.0)

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

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

Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。

@param error_message エラーメッセージを表す文字列を指定します。

//emlist[例][ruby]{
begin
# ... # 何か処理
rescue => e
raise e.exception("an error occurs during hogeho...

絞り込み条件を変える

SystemCallError.new(errno) -> SystemCallError (34.0)

整数 errno に対応する Errno::EXXX オブジェクトを生成して返します。

整数 errno に対応する Errno::EXXX オブジェクトを生成して返します。

整数 errno をシステムコールで発生したエラーの原因を示すコードであると解釈し、
対応する例外クラスのインスタンスを生成して返します。

生成されるオブジェクトは SystemCallError の直接のインスタンスではなく、サブクラスのインスタンスです。
それらのサブクラスは Errno モジュール内に定義されています。
対応するサブクラスが存在しないコードを与えた場合には、 SystemCallError の直接のインスタンスが生成されます。

エラーコードの取り得る値および意味はシステムに依存し...

Errno::EXXX.new() -> Errno::EXXX (28.0)

Errno::EXXX オブジェクトを生成して返します。

Errno::EXXX オブジェクトを生成して返します。

@param error_message エラーメッセージを表す文字列

p Errno::ENOENT.new
# => #<Errno::ENOENT: No such file or directory>
p Errno::ENOENT.new('message')
# => #<Errno::ENOENT: No such file or directory - message>