Skip Menu |

This queue is for tickets about the Params-Validate CPAN distribution.

Report information
The Basics
Id: 111036
Status: resolved
Priority: 0/
Queue: Params-Validate

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.21
Fixed in: 1.22



Subject: Different error messages between PP and XS version
Error messages differ between the pure perl and the XS version: $ env PARAMS_VALIDATE_IMPLEMENTATION=XS perl5.22.1 -MParams::Validate=validate -e '@_ = ("foo", "bar"); validate(@_, { foo => { callbacks => { "check name" => sub { $_[0] =~ /baz/ } } } })' The 'foo' parameter ("bar") to (unknown) did not pass the 'check name' callback: at -e line 1. $ env PARAMS_VALIDATE_IMPLEMENTATION=PP perl5.22.1 -MParams::Validate=validate -e '@_ = ("foo", "bar"); validate(@_, { foo => { callbacks => { "check name" => sub { $_[0] =~ /baz/ } } } })' The 'foo' parameter ("bar") to N/A did not pass the 'check name' callback at /opt/perl-5.22.1/lib/site_perl/5.22.1/x86_64-linux/Params/Validate/PP.pm line 670. Params::Validate::PP::__ANON__("The 'foo' parameter (\"bar\") to N/A did not pass the 'check na"...) called at /opt/perl-5.22.1/lib/site_perl/5.22.1/x86_64-linux/Params/Validate/PP.pm line 580 Params::Validate::PP::_validate_one_param("bar", HASH(0x1e0b7f8), HASH(0x1e011e8), "The 'foo' parameter (%s)") called at /opt/perl-5.22.1/lib/site_perl/5.22.1/x86_64-linux/Params/Validate/PP.pm line 341 Params::Validate::PP::validate(ARRAY(0x1dee0e8), HASH(0x1e01260)) called at -e line 1 At least the trailing colon in the XS version makes no sense to me and should probably be removed. The N/A vs. unknown stuff could maybe be harmonized. And the existence of a stack trace in the pure perl version is debatable; maybe Carp shouldn't be used here? At least most people use XS implementation and never see a stack trace. I stumbled over this because of a test fail in Google-reCAPTCHA: https://rt.cpan.org/Ticket/Display.html?id=110974 The tests here check for expected error messages and fail when the PP version of Params::Validate is installed.