Dry::Types::ConstraintError
not propagated when originating from inside a Dry::Types::Map
#190
Labels
Dry::Types::ConstraintError
not propagated when originating from inside a Dry::Types::Map
#190
Describe the bug
Given the following code:
one would expect the following input:
to generate an error message related to the constraint being violated. Instead, we get the following error message:
The error originate from here:
https://github.com/dry-rb/dry-types/blob/ffde4175a833c6911cc889e7b1b4717bc712d3be/lib/dry/types/nominal.rb#L121-L125
and I assume
error
received is aMultipleError
judging by this code:https://github.com/dry-rb/dry-types/blob/ffde4175a833c6911cc889e7b1b4717bc712d3be/lib/dry/types/map.rb#L132-L136
Should the check:
perhaps be changed into this?
Expected behavior
I expect a
Dry::Struct::Error
to be raised that propagates the actualDry::Types::ConstraintError
error.My environment
The text was updated successfully, but these errors were encountered: