Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate exceptions raised from #to_int in Time::at offset parsing #2094

Open
lopopolo opened this issue Aug 21, 2022 · 0 comments
Open

Propagate exceptions raised from #to_int in Time::at offset parsing #2094

lopopolo opened this issue Aug 21, 2022 · 0 comments
Labels
A-ruby-core Area: Ruby Core types. B-mruby Backend: Implementation of artichoke-core using mruby. C-bug Category: This is a bug.

Comments

@lopopolo
Copy link
Member

we need to short circuit return from implicitly_convert_to_int here to handle this case:

[3.1.2] > class A; def to_int; raise 'bam'; end; end
=> :to_int
[3.1.2] > Time.at(12, in: A.new)
(irb):6:in `to_int': bam (RuntimeError)
        from <internal:timev>:274:in `at'
        from (irb):7:in `<main>'
        from /usr/local/var/rbenv/versions/3.1.2/lib/ruby/gems/3.1.0/gems/irb-1.4.1/exe/irb:11:in `<top (required)>'
        from /usr/local/var/rbenv/versions/3.1.2/bin/irb:25:in `load'
        from /usr/local/var/rbenv/versions/3.1.2/bin/irb:25:in `<main>'

Originally posted by @lopopolo in #1956 (comment)

@lopopolo lopopolo added C-bug Category: This is a bug. A-ruby-core Area: Ruby Core types. B-mruby Backend: Implementation of artichoke-core using mruby. labels Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ruby-core Area: Ruby Core types. B-mruby Backend: Implementation of artichoke-core using mruby. C-bug Category: This is a bug.
Development

No branches or pull requests

1 participant