Method: Fear::TryApi#try
- Defined in:
- lib/fear/try_api.rb
#try ⇒ Fear::Try
Constructs a Try
using the block. This method ensures any non-fatal exception is caught and a Failure
object is returned.
13 14 15 16 17 |
# File 'lib/fear/try_api.rb', line 13 def try success(yield) rescue StandardError => error failure(error) end |