Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error reporting of failed validations [PRC] #10

merged 1 commit into from Jul 11, 2018


Copy link

@jjatria jjatria commented Jun 21, 2018

This is an attempt at improving the error reporting when calls to validation fail, to address #7.

This maintains most of the existing error message, but extends it by appending the result of calling document on the failed coderef.

The result is something like this:

$ perl -Ilib -E '
    use Params::Validate::Dependencies qw( :all ); 
    my @args = ( foo => 1 ); 
            foo => 0, 
            bar => 0,
        one_of( all_of("foo"), all_of("bar") )
code-ref checking failed: arguments were not one of (all of ('foo') or all of ('bar'))

Keeping the existing part of the error message meant that the tests did not need to be changed. 馃帀

Copy link

@coveralls coveralls commented Jun 21, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling c89f80a on jjatria:sucky-docs into b212057 on DrHyde:master.

@DrHyde DrHyde merged commit 808cec6 into DrHyde:master Jul 11, 2018
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
coverage/coveralls Coverage remained the same at 100.0%
Copy link

@DrHyde DrHyde commented Jul 11, 2018

Thanks, merged

@DrHyde DrHyde mentioned this pull request Jul 11, 2018
Copy link

@DrHyde DrHyde commented Jul 11, 2018

I'll push a release to the CPAN with this and your other PRs tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants