module Dry::Monads::Try::Value::Error::Mixin::Constructors
@private
Public Instance Methods
Source
# File lib/dry/monads/try.rb, line 259 def Try(*exceptions, &f) catchable = exceptions.empty? ? DEFAULT_EXCEPTIONS : exceptions.flatten Try.run(catchable, f) end
A convenience wrapper for {Monads::Try.run}. If no exceptions are provided it falls back to StandardError. In general, relying on this behaviour is not recommended as it can lead to unnoticed bugs and it is always better to explicitly specify a list of exceptions if possible.
@param exceptions [Array<Exception>] @return [Try]