Skip to content

Uninitialized Constants Not Rescuing #635

Closed
ROFISH opened this Issue Dec 17, 2012 · 0 comments

2 participants

@ROFISH
ROFISH commented Dec 17, 2012

mruby does not appear to be rescuing NameError:

begin
  Klass
rescue Exception=>e
  p "rescuing from name error: #{e}"
end

Ruby 1.9.3 output:

"rescuing from name error: uninitialized constant Klass"

mruby output:

trace:
    [0] test.rb:5
NameError: uninitialized constant Klass

Expected:

rescue will rescue from any error, instead of ending.

Note that mruby does rescue from this:

begin
  klass
rescue Exception=>e
  p "rescuing from name error: #{e}"
end

Resulting in:

"rescuing from name error: undefined method 'klass' for main"
@matz matz closed this in 9de76a7 Dec 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.