ライブラリ
- English (11)
- ビルトイン (408)
- bigdecimal (113)
- e2mmap (78)
- fileutils (22)
- matrix (11)
-
minitest
/ unit (4) -
net
/ http (6) - rexml (66)
-
rubygems
/ commands / lock _ command (11) -
rubygems
/ exceptions (33) -
rubygems
/ gem _ openssl (11) -
rubygems
/ security (11) -
rubygems
/ spec _ fetcher (11) - stringio (11)
- timeout (41)
-
webrick
/ httpauth / authenticator (22)
クラス
-
ARGF
. class (9) - BigDecimal (101)
-
Encoding
:: Converter (11) - Exception (91)
- Fiber (5)
-
Gem
:: Commands :: LockCommand (11) -
Gem
:: Security :: Policy (11) -
Gem
:: SpecFetcher (11) - IO (22)
-
MiniTest
:: Unit (2) -
MiniTest
:: Unit :: TestCase (1) -
REXML
:: ParseException (44) - SignalException (55)
- StringIO (11)
- Thread (49)
モジュール
- Exception2MessageMapper (78)
- FileUtils (22)
- Gem (11)
- Kernel (200)
-
MiniTest
:: Assertions (1) - Timeout (19)
-
WEBrick
:: HTTPAuth :: Authenticator (11) -
WEBrick
:: HTTPAuth :: ProxyAuthenticator (11)
キーワード
-
$ ! (11) -
$ ERROR _ INFO (11) - == (11)
- AuthException (22)
- BigDecimal (12)
- Complex (12)
- DependencyRemovalException (11)
-
EXCEPTION
_ ALL (11) -
EXCEPTION
_ INFINITY (11) -
EXCEPTION
_ NaN (11) -
EXCEPTION
_ OVERFLOW (11) -
EXCEPTION
_ UNDERFLOW (11) -
EXCEPTION
_ ZERODIVIDE (11) - EndOfYAMLException (11)
- ErrNotRegular (11)
- Fail (12)
- Float (6)
- HTTPClientException (6)
- Integer (6)
- InvalidSpecificationException (11)
-
PASSTHROUGH
_ EXCEPTIONS (1) - ParseException (11)
- Raise (12)
- Rational (6)
- Rubyの起動 (3)
- Ruby用語集 (11)
- SignalException (11)
- UndefinedNamespaceException (11)
-
abort
_ on _ exception (22) -
backtrace
_ locations (11) - bind (6)
- cause (11)
- complain (11)
- context (11)
- debug (11)
-
def
_ exception (12) -
ensure
_ ssl _ available (11) -
exception
_ details (1) -
extend
_ object (6) - fail (39)
-
handle
_ interrupt (11) -
last
_ error (11) - line (11)
- location (1)
- logger (11)
- mode (22)
- new (46)
- position (11)
- puke (1)
- raise (38)
-
read
_ nonblock (31) - remove (11)
-
report
_ on _ exception (16) - rm (11)
-
save
_ exception _ mode (11) -
set
_ backtrace (11) - signm (11)
- signo (11)
- spawn (24)
- system (24)
- timeout (41)
-
to
_ s (11) -
to
_ tty? (7) -
verify
_ gem (11) -
warn
_ legacy (11) -
write
_ nonblock (11) - 制御構造 (11)
検索結果
先頭5件
- Exception
. exception(error _ message = nil) -> Exception - Exception
# exception -> self - Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] - Exception2MessageMapper
. def _ exception(klass , exception _ name , message _ format , superklass = StandardError) -> Class - Exception2MessageMapper
# def _ exception(exception _ name , message _ format , superclass = StandardError) -> Class
-
Exception
. exception(error _ message = nil) -> Exception (36539.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 -> self (36331.0) -
引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。
...引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー
を生成し Exception#message 属性を error_message にして返します。
Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。
@pa......ram error_message エラーメッセージを表す文字列を指定します。
//emlist[例][ruby]{
begin
# ... # 何か処理
rescue => e
raise e.exception("an error occurs during hogehoge process") # 詳しいエラーメッセージ
end
//}... -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (24446.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...Exception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return if......aise "#{month} is not long month"
end
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:i......n `<main>'"]
//}
@see Exception#backtrace... -
Exception2MessageMapper
. def _ exception(klass , exception _ name , message _ format , superklass = StandardError) -> Class (18724.0) -
exception_name という名前の例外クラスを定義します。
...
exception_name という名前の例外クラスを定義します。
@param klass 一階層上となるクラス名を指定します。
@param exception_name 例外クラスの名前をシンボルで指定します。
@param message_format メッセージのフォーマットを指定しま......す。
Kernel.#sprintf のフォーマット文字列と同じ形式を使用できます。
@param superklass 定義する例外クラスのスーパークラスを指定します。
省略すると StandardError を使用します。
@return 定義した例... -
Exception2MessageMapper
# def _ exception(exception _ name , message _ format , superclass = StandardError) -> Class (18624.0) -
exception_name という名前の例外クラスを定義します。
...
exception_name という名前の例外クラスを定義します。
@param exception_name 定義する例外クラスの名前をシンボルで指定します。
@param message_format メッセージのフォーマット。
@param superclass 定義する例外のスーパークラスを指定... -
MiniTest
:: Assertions # exception _ details(exception , message) -> String (18508.0) -
与えられた例外の詳細を文字列として返します。
...与えられた例外の詳細を文字列として返します。
@param exception 例外を指定します。
@param message メッセージを指定します。... -
Exception
. new(error _ message = nil) -> Exception (18339.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"
//}... -
BigDecimal
:: EXCEPTION _ ALL -> Integer (18331.0) -
BigDecimal の計算において例外を発生させるかどうかを設定、確認する 際の値を返します。
...BigDecimal の計算において例外を発生させるかどうかを設定、確認する
際の値を返します。
以下の例外全てが対象です。
* BigDecimal::EXCEPTION_INFINITY
* BigDecimal::EXCEPTION_NaN
* BigDecimal::EXCEPTION_OVERFLOW
* BigDecimal::EXCEPTION_UNDERFLOW
* Bi......gDecimal::EXCEPTION_ZERODIVIDE
BigDecimal.mode の第 1 引数に指定します。... -
Exception
# full _ message(highlight: true , order: :bottom) -> String (18318.0) -
例外の整形された文字列を返します。
...て実際に、キーワード引数 highlight と order は 2.5.1 で追加されました。
@param highlight エスケープシーケンスによる文字装飾をつけるかどうかを指定します。
デフォルト値は Exception.to_tty? の返り値と同じです。
@...... Exception.to_tty? が真なら :bottom で偽なら :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_mes......sage # => "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?......シーケンスによる文字装飾がついています。
@param highlight エスケープシーケンスによる文字装飾をつけるかどうかを指定します。
デフォルト値は Exception.to_tty? の返り値と同じです。
@param order :top か :bottom で... -
BigDecimal
:: EXCEPTION _ OVERFLOW -> Integer (18301.0) -
BigDecimal の計算結果の指数部がオーバーフローした場合に例外を発生 させるかどうかを設定、確認する際の値を返します。
...BigDecimal の計算結果の指数部がオーバーフローした場合に例外を発生
させるかどうかを設定、確認する際の値を返します。
BigDecimal.mode の第 1 引数に指定します。... -
BigDecimal
:: EXCEPTION _ UNDERFLOW -> Integer (18301.0) -
BigDecimal の計算結果の指数部がアンダーフローした場合に例外を発生 させるかどうかを設定、確認する際の値を返します。
...BigDecimal の計算結果の指数部がアンダーフローした場合に例外を発生
させるかどうかを設定、確認する際の値を返します。
BigDecimal.mode の第 1 引数に指定します。... -
SignalException (18006.0)
-
捕捉していないシグナルを受け取ったときに発生します。
...、
Exception#message から
「"SIG" + シグナル名」という形で得られます。
デフォルトの状態では、
以下のシグナルが SignalException を発生させます。
* SIGALRM
* SIGHUP
* SIGINT (※ただし以下参照)
* SIGQUIT
* SIGUSR1
* SIGUSR2
* SIGTE......RM
なお、SIGINT シグナルを受けた場合は SignalException の下位クラスである
Interrupt が発生します。...