Skip to content

Match MRI's default exception message display on RuntimeError with empty message #3255

@nirvdrum

Description

@nirvdrum

While working on eliminating the number of tests skipped on TruffleRuby in the IRB test suite with @st0012, we ran into a case where TruffleRuby doesn't report that an exception was unhandled the same way as MRI. There are two different tests in IRB that check for the text "unhandled exception". While I believe this is only a display issue, if we can match MRI cheaply we should do so.

> ruby -v -e 'def hoge() fuga; end; def fuga() raise; end; hoge'
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]
-e:1:in `fuga': unhandled exception
        from -e:1:in `hoge'
        from -e:1:in `<main>'
> jt ruby -v -e 'def hoge() fuga; end; def fuga() raise; end; hoge'
truffleruby 24.0.0-dev-260d07b7, like ruby 3.2.2, GraalVM CE JVM [aarch64-darwin]
-e:1:in `fuga':  (RuntimeError)
        from -e:1:in `hoge'
        from -e:1:in `<main>'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions