$ERROR_POSITION -> [String] | nil[permalink][rdoc][edit] [added by English]-
$@ の別名
require "English" class SomethingError < StandardError; end begin raise SomethingError rescue p $ERROR_POSITION #=> ["sample.rb:5"] end
このマニュアルは既にメンテナンスが終了したバージョンの Ruby を対象としています。 最新版のマニュアルへ
$ERROR_POSITION -> [String] | nil[permalink][rdoc][edit] [added by English]
$@ の別名
require "English"
class SomethingError < StandardError; end
begin
raise SomethingError
rescue
p $ERROR_POSITION #=> ["sample.rb:5"]
end