Skip Menu |

This queue is for tickets about the Net-Akamai CPAN distribution.

Report information
The Basics
Id: 61837
Status: open
Priority: 0/
Queue: Net-Akamai

People
Owner: Nobody in particular
Requestors: jeronimo [...] dcheetah.com
Cc:
AdminCc:

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



Subject: Bug and Solution found.
Date: Fri, 1 Oct 2010 16:17:48 -0500
To: "bug-Net-Akamai [...] rt.cpan.org" <bug-Net-Akamai [...] rt.cpan.org>
From: Jeronimo Robles <jeronimo [...] dcheetah.com>
Net::Akamai Module Version: 0.13 Perl Version 5.8.4 OS Linux 2.6.9-89.0.16.ELsmp Displayed error: "Attribute (res_data) does not pass the type constraint because: Validation failed for 'Net::Akamai::ResponseData' with value HASH(0x8cc3274) (not isa Net::Akamai::ResponseData) at /usr/local/ActivePerl-5.8/lib/site_perl/5.8.4/Net/Akamai.pm line 146" Solution: Move the coerce restriction before the has 'res_data' coerce 'Net::Akamai::ResponseData' => from 'HashRef' => via { Net::Akamai::ResponseData->new($_) }; has 'res_data' => ( is => 'rw', isa => 'Net::Akamai::ResponseData', coerce => 1, ); Regards, Jeronimo
Getting a similar error on a newer version of Moose: You cannot coerce an attribute (res_data) unless its type (Net::Akamai::ResponseData) has a coercion Moving "coerce" above "has" seems to work.
If this is still happening please submit a pull request here: https://github.com/jgoulah/Net-Akamai I will be happy to merge once the pull request is submitted. On Wed Jun 26 15:55:46 2013, pboyd wrote: Show quoted text
> Getting a similar error on a newer version of Moose: > > You cannot coerce an attribute (res_data) unless its type > (Net::Akamai::ResponseData) has a coercion > > Moving "coerce" above "has" seems to work.