On Mon Oct 31 14:52:42 2011, alex@affiliateplex.com wrote:
Show quoted text> Hey Tim,
>
> Nice module, exactly what need!
>
> There's only one problem. If API return error, it just dump $xml and
> return nothing. I think the right way is to return $xml and let user
> handle error (show nice formated error message, etc.)
>
> if ($xml->{Status} eq 'ERROR') {
> #print STDERR Data::Dumper::Dumper \$xml;
> return $xml;
> }
Alexander,
Thanks for the report, and I'm glad you find the module useful! You're
absolutely correct, this is very poor behavior, which I put in for
testing and never corrected. :) I've just uploaded version 0.05 to CPAN
which corrects this issue. Now errors result in an undef return from
the appropriate subroutine, and if you get undef, you can check
$api->error(), which will return the full XML of the last error
returned, to get at the information as appropriate for your application.
I hope this solution works well for you, please give it a try and let
me know! It may take a few hours for version 0.05 to filter through
CPAN, but it should be available soon. I've also placed it directly on
the project's GitHub site should you wish to download it from there:
https://github.com/downloads/twilde/WWW-Namecheap-API/WWW-Namecheap-API-0.05.tar.gz
Please let me know how it works for you!
Best regards,
Tim Wilde
Show quoted text>
>
>
> Thank you.