Closed shamas- closed 8 months ago
Repro steps:
Monetize.parse(1+3i)
Expected:
=> nil
Actual:
ArgumentError: Unable to make a BigDecimal from non-zero imaginary number
Using Ruby 3.0.6.
It might be because Error inherits from StandardError https://github.com/RubyMoney/monetize/blob/e2e2f1f2dbc8e599797f7582dc389bdde9ac6999/lib/monetize/errors.rb#L2
Error
StandardError
and is used here https://github.com/RubyMoney/monetize/blob/e2e2f1f2dbc8e599797f7582dc389bdde9ac6999/lib/monetize.rb#L29-L33
If I do
begin Monetize.parse(1+3i) rescue StandardError pp 'hi there' end
the error is rescued.
please submit a PR for consideration
Repro steps:
Expected:
Actual:
Using Ruby 3.0.6.
It might be because
Error
inherits fromStandardError
https://github.com/RubyMoney/monetize/blob/e2e2f1f2dbc8e599797f7582dc389bdde9ac6999/lib/monetize/errors.rb#L2and is used here https://github.com/RubyMoney/monetize/blob/e2e2f1f2dbc8e599797f7582dc389bdde9ac6999/lib/monetize.rb#L29-L33
If I do
the error is rescued.