るりまサーチ

最速Rubyリファレンスマニュアル検索!
245件ヒット [1-100件を表示] (0.084秒)

別のキーワード

  1. etc sc_message_passing
  2. etc sc_2_pbs_message
  3. getoptlong error_message
  4. mkmf message
  5. exception message

検索結果

<< 1 2 3 > >>

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

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

...指定した場合 自身のコピー
を生成し 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 (27282.0)

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

...指定した場合 自身のコピー
を生成し 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
//}...

Exception2MessageMapper#Raise(exception_class = nil, *rest) -> () (21375.0)

登録されている情報を使用して、例外を発生させます。

...m exception_class 例外クラス。

@param rest メッセージに埋め込む値。

@raise Exception2MessageMapper::ErrNotRegisteredException 指定された例外クラスに対応するメッセージが存在しない場合に発生します。

例:

class Foo
extend Exception2MessageM...
...p def_exception :NewExceptionClass, "message...%d, %d and %d" # =>

def foo
Raise
NewExceptionClass, 1, 2, 3
end
end

Foo.new().foo() #=> in `Raise': message...1, 2 and 3 (Foo::NewExceptionClass)
# という例外が発生します。

Foo.Raise Foo::...
...NewExceptionClass, 1, 3, 5 #=> in `Raise': message...1, 3 and 5 (Foo::NewExceptionClass)
# という例外が発生します。...

Exception2MessageMapper.Raise(klass = E2MM, exception_class = nil, *rest) -> () (21321.0)

登録されている情報を使用して、例外を発生させます。

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

@param exception_class 例外クラス。

@param rest メッセージに埋め込む値。

@raise Exception2MessageMapper::ErrNotRegisteredException 指定された例外クラスに対応するメッセージが存在しない...

Exception#full_message(highlight: true, order: :bottom) -> String (15243.0)

例外の整形された文字列を返します。

...値は Exception.to_tty? の返り値と同じです。

@param order :top か :bottom で指定する必要があります。
バックトレースの一番奥がエラーメッセージの上(top)か下(bottom)かを指定します。
デフォルト値は Exception.to_tt...
...ら :top です。

//emlist[例][ruby]{
begin
raise
"test"
rescue => e
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"
$stderr = $stdout
p e.full_message # => "test.rb:2:in `<main>': test (Runtime...
...Error)\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?...

絞り込み条件を変える

Exception2MessageMapper#def_e2message(exception_class, message_format) -> Class (12471.0)

すでに存在する例外クラス exception_class に、 エラーメッセージ用フォーマット message_format を関連づけます。

...に存在する例外クラス exception_class に、
エラーメッセージ用フォーマット message_format を関連づけます。

このフォーマットは Exception2MessageMapper#Raise,
Exception
2MessageMapper#Fail で使用します。

@param exception_class メッセージを登録...
...する例外クラスを指定します。

@param message_format メッセージのフォーマットを指定します。
Kernel.#sprintf のフォーマット文字列と同じ形式を使用できます。

@return exception_class を返します。...

Exception#==(other) -> bool (9170.0)

自身と指定された other のクラスが同じであり、 message と backtrace が == メソッドで比較して 等しい場合に true を返します。そうでない場合に false を返します。

...自身と指定された other のクラスが同じであり、
message
と backtrace が == メソッドで比較して
等しい場合に true を返します。そうでない場合に false を返します。

@param other 自身と比較したいオブジェクトを指定します。...
...トを指定した場合は
Exception
#exception を実行して変換を試みます。

//emlist[例][ruby]{
require "date"
def check_long_month(month)
return if Date.new(2000, month, -1).day == 31
raise
"#{month} is not long month"
end

def get_exception
return begin
yield...
...lts = [2, 2, 4].map { |e | get_exception { check_long_month(e) } }
p results.map { |e| e.class }
# => [RuntimeError, RuntimeError, RuntimeError]
p results.map { |e| e.message }
# => ["2 is not long month", "2 is not long month", "4 is not long month"]

# class, message, backtrace が同一のため...

Exception#inspect -> String (9134.0)

self のクラス名と message を文字列にして返します。

...self のクラス名と message を文字列にして返します。

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

Fiber#raise(exception, message = nil, backtrace = nil) -> object (6460.0)

selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。

...、RuntimeError が発生します。
message
引数を渡した場合、message 引数をメッセージとした RuntimeError
が発生します。

その他のケースでは、最初の引数は Exception Exception
のインスタンスを返す exception メソッドを持ったオブジ...
...@param message 例外のメッセージとなる文字列です。
@param exception 発生させる例外です。
@param backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。

//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.raise "Error...
...!" # => Error! (RuntimeError)
//}

//emlist[ファイバー内のイテレーションを終了させる例][ruby]{
f = Fiber.new do
loop do
Fiber.yield(:loop)
end
:exit
end

p f.resume # => :loop
p f.raise StopIteration # => :exit
//}...

Fiber#raise(message) -> object (6360.0)

selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。

...、RuntimeError が発生します。
message
引数を渡した場合、message 引数をメッセージとした RuntimeError
が発生します。

その他のケースでは、最初の引数は Exception Exception
のインスタンスを返す exception メソッドを持ったオブジ...
...@param message 例外のメッセージとなる文字列です。
@param exception 発生させる例外です。
@param backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。

//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.raise "Error...
...!" # => Error! (RuntimeError)
//}

//emlist[ファイバー内のイテレーションを終了させる例][ruby]{
f = Fiber.new do
loop do
Fiber.yield(:loop)
end
:exit
end

p f.resume # => :loop
p f.raise StopIteration # => :exit
//}...

絞り込み条件を変える

Exception2MessageMapper#Fail(exception_class = nil, *rest) -> () (6275.0)

登録されている情報を使用して、例外を発生させます。

...m exception_class 例外クラス。

@param rest メッセージに埋め込む値。

@raise Exception2MessageMapper::ErrNotRegisteredException 指定された例外クラスに対応するメッセージが存在しない場合に発生します。

例:

class Foo
extend Exception2MessageM...
...p def_exception :NewExceptionClass, "message...%d, %d and %d" # =>

def foo
Raise
NewExceptionClass, 1, 2, 3
end
end

Foo.new().foo() #=> in `Raise': message...1, 2 and 3 (Foo::NewExceptionClass)
# という例外が発生します。

Foo.Raise Foo::...
...NewExceptionClass, 1, 3, 5 #=> in `Raise': message...1, 3 and 5 (Foo::NewExceptionClass)
# という例外が発生します。...

Fiber#raise -> object (6260.0)

selfが表すファイバーが最後に Fiber.yield を呼んだ場所で例外を発生させます。

...、RuntimeError が発生します。
message
引数を渡した場合、message 引数をメッセージとした RuntimeError
が発生します。

その他のケースでは、最初の引数は Exception Exception
のインスタンスを返す exception メソッドを持ったオブジ...
...@param message 例外のメッセージとなる文字列です。
@param exception 発生させる例外です。
@param backtrace 例外発生時のスタックトレースです。文字列の配列で指定します。

//emlist[例][ruby]{
f = Fiber.new { Fiber.yield }
f.resume
f.raise "Error...
...!" # => Error! (RuntimeError)
//}

//emlist[ファイバー内のイテレーションを終了させる例][ruby]{
f = Fiber.new do
loop do
Fiber.yield(:loop)
end
:exit
end

p f.resume # => :loop
p f.raise StopIteration # => :exit
//}...

Exception2MessageMapper.Fail(klass = E2MM, exception_class = nil, *rest) -> () (6221.0)

登録されている情報を使用して、例外を発生させます。

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

@param exception_class 例外クラス。

@param rest メッセージに埋め込む値。

@raise Exception2MessageMapper::ErrNotRegisteredException 指定された例外クラスに対応するメッセージが存在しない...

Exception2MessageMapper#fail(exception_class = nil, *rest) -> () (6219.0)

登録されている情報を使用して、例外を発生させます。

...されている情報を使用して、例外を発生させます。

@param exception_class 例外クラス。

@param rest メッセージに埋め込む値。

@raise Exception2MessageMapper::ErrNotRegisteredException 指定された例外クラスに対応するメッセージが存在しない...
<< 1 2 3 > >>