Skip Menu |

This queue is for tickets about the WWW-Namecheap-API CPAN distribution.

Report information
The Basics
Id: 72074
Status: patched
Priority: 0/
Queue: WWW-Namecheap-API

People
Owner: TWILDE [...] cpan.org
Requestors: alex [...] affiliateplex.com
Cc:
AdminCc:

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



Subject: WWW::Namecheap::DNS
Date: Mon, 31 Oct 2011 14:51:31 -0400
To: bug-www-namecheap-api [...] cpan.org
From: Alexander Yusupov <alex [...] affiliateplex.com>
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; } Thank you.
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.