Feedback request for suggested changes in Moose.git/topic/validation-passthrough-objects

[email protected] (Kent Fredric)
Newsgroups perl.moose
Message-ID <[email protected]>
Hi.

I've pushed some suggested changes as
'topic/validation-passthrough-objects' for Moose::Meta::Attribute to
permit the validation phase to pass-through any results from type
constraints 'get_message' function if they so happen to be objects (
or any other kind of ref ).

The idea is that we can be permitted to create more deeply structured
validation failures ( ie: Exception Objects ) that more accurately
describe why the validation failed.

This is more pertinent with nested/parametrized type constraints.

Presently, no native type constraints throw exceptions, and the system
relies completely on string error messages.

I have, alternatively, a module that will hack this behaviour on to
attributes on a case-by-case basis (
http://search.cpan.org/dist/MooseX-Attribute-ValidateWithException/ )
but I'd much rather do away with that forever and make something much
more powerful and practical as part of Moose itself.

Critique welcome.

For those who do not wish to have to use git directly to see the
proposed changes, here is a link to the diff on github:

https://github.com/moose/moose/compare/master...topic/validation-passthrough-objects

-- 
Kentnl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.