<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    MooseX::Attribute::ValidateWithException - Cause validation failures to
    throw exception objects.

VERSION
    version 0.1.1

SYNOPSIS
      {
        package Foo;
        use Moose;
        use MooseX::Attribute::ValidateWithException;

        has foo =&gt; (
          isa =&gt; 'Str',
          is  =&gt; 'rw',
          required =&gt; 1,
        );
        __PACKAGE__-&gt;meta-&gt;make_immutable;
        no Moose;
      }

      use Try::Tiny;

      try {
        Foo-&gt;new( foo =&gt; { this_is =&gt; [qw( not what we were wanting )] } );
      } catch {
        say $_-&gt;name if blessed( $_ ) &amp;&amp; $_-&gt;isa('Thingy');
      };

DESCRIPTION
    ALPHA QUALITY SOFTWARE.

    At present, when an attribute fails validation, Moose internally die()'s
    with a string. There is also no way to throw an exception object as part
    of the validation message, ( in order to give more context on the
    problem ), without also breaking how much of the validation works.

    This module is an experiment in providing that feature, which really
    should be done in Moose itself, and done better, which is why it has
    been given such an obtuse name.

    This module makes no promises of forwards compatibility with a future
    Moose release, in order to permit Moose to do whatever they want and not
    worry about "breaking code" that uses this module. ( So that they can
    easily replace this module in incompatible ways )

    If your code breaking is unacceptable, do *not* use this module.

    Use of this module assumes several things.

    1. You are o.k. with your code breaking in a future Moose release.
    2. You are o.k. with re-writing any and all code that depends on this
    functionality, if a future Moose release is incompatible with this
    module.

    I'm not saying I won't do my best to provide forwards compatibility, but
    it is highly unlikely it will be possible, due to differences in package
    naming which may be essential for handling exceptions.

AUTHOR
    Kent Fredric &lt;kentnl@cpan.org&gt;

COPYRIGHT AND LICENSE
    This software is copyright (c) 2011 by Kent Fredric &lt;kentnl@cpan.org&gt;.

    This is free software; you can redistribute it and/or modify it under
    the same terms as the Perl 5 programming language system itself.

</pre></body></html>