4 ms·
I think you are confused, `try` is not raise/rescue. The ActiveSupport `try` implementation does not involve allowing an exception to be raised. https://github
by jrochkind1 11y ago
I think you are confused, `try` is not raise/rescue. The ActiveSupport `try` implementation does not involve allowing an exception to be raised.
https://github.com/rails/rails/blob/v4.2.5/activesupport/lib/active_support/core_ext/object/try.rb#L69-L80 https://github.com/rails/rails/blob/v4.2.5/activesupport/lib...
It should be as performant as other ways of checking for nil/empty.
- chrisseaton 11y agoAh yes you're right - I was confusing this with raise/rescue.