Perl API and error handling

Joachim Bauernberger joachim.bauernberger@friendscout24.de
Wed, 18 Feb 2004 09:27:17 +0100


Hi Brad,

On Tuesday 17 February 2004 19:57, Brad Fitzpatrick wrote:
> Generally I've never needed the return code for failing adds/sets.  I'd
> take a patch, though, if you need it.
>

One can check the serverlogs if errors are happening inside memcached, howe=
ver=20
this requires a separate script that constantly monitors the memcached logs.

So I think it's nice if the client can take proper action in case if the=20
memcached server returned out of memory, unable to open fd's or=20
whatever ......



> I'm not sure $! is the best place, however.  Perhaps
> $memc->err / $memc->errstr like DBI?

Yes that would be neat and surely more elegant than $!

Thanks,
~/joachim

>
> On Fri, 13 Feb 2004, Joachim Bauernberger wrote:
> > Hi,
> >
> > I was wondering how you guys trap errors in the perl API.
> > If for example $memd->set or $memd->add fails it says that undef is
> > returned, but will I know the reason for the failure (maybe in $!).
> >
> > perldoc Cache::Memcached does not mention this.
> >
> > Thanks & regards,
> > ~/joachim
> >
> > --
> > Phone: +49 (0) 89 490 267 726
> > Fax: +49 (0) 89 490 267 701
> > Mobile: +49 (0) 179 674 3611
> > mailto: joachim.bauernberger@friendscout24.de =A0 =A0 =A0 =A0
> > Web: http://www.friendscout24.de

=2D-=20
Phone: +49 (0) 89 490 267 726
=46ax: +49 (0) 89 490 267 701
Mobile: +49 (0) 179 674 3611
mailto: joachim.bauernberger@friendscout24.de =A0 =A0 =A0 =A0=20
Web: http://www.friendscout24.de