Skip to content

English: $ERROR_INFO doesn't refer to the last error that was raised #1660

@deepj

Description

@deepj

This construct is used in dry-monads specs https://github.com/dry-rb/dry-monads/blob/master/spec/unit/try_spec.rb#L14

$ERROR_INFO is alias of $!

TruffleRuby 1.0.0 RC15

require 'English'
division_error = 1 / 0 rescue $ERROR_INFO
# => nil

MRI 2.6.2

require 'English'
division_error = 1 / 0 rescue $ERROR_INFO
# => #<ZeroDivisionError: divided by 0>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions