Skip to content

Exception#cause difference with CRuby #4239

Open
@nateberkopec

Description

Environment

JRuby 9.1.5.0
All platforms

Expected Behavior

def build_exception_with_cause
  begin
    1 / 0
  rescue ZeroDivisionError
    1 / 0
  end
rescue ZeroDivisionError => exception
  return exception
end

exc = build_exception_with_cause
exc.cause # MRI: #<ZeroDivisionError: divided by 0>

Actual Behavior

exc = build_exception_with_cause
exc.cause # JRuby: nil

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions