Sha256: d0334e307aa941e9047bc787c5ee128456a5c04f070bab594075fac63d8d5527

Contents?: true

Size: 498 Bytes

Versions: 8

Compression:

Stored size: 498 Bytes

Contents

module Dry
  module Monads
    # An unsuccessful result of extracting a value from a monad.
    class UnwrapError < StandardError
      def initialize(ctx)
        super("value! was called on #{ ctx.inspect }")
      end
    end

    # An error thrown on returning a Failure of unknown type.
    class InvalidFailureTypeError < StandardError
      def initialize(failure)
        super("Cannot create Failure from #{ failure.inspect }, it doesn't meet the constraints")
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
dry-monads-1.2.0 lib/dry/monads/errors.rb
dry-monads-1.1.0 lib/dry/monads/errors.rb
dry-monads-1.0.1 lib/dry/monads/errors.rb
dry-monads-1.0.0 lib/dry/monads/errors.rb
dry-monads-1.0.0.rc1 lib/dry/monads/errors.rb
dry-monads-1.0.0.beta3 lib/dry/monads/errors.rb
dry-monads-1.0.0.beta2 lib/dry/monads/errors.rb
dry-monads-1.0.0.beta1 lib/dry/monads/errors.rb