cvs: pearbot /modules bugstats.php

From: Date: Sat, 21 Aug 2004 21:03:17 +0000
Subject: cvs: pearbot /modules bugstats.php
Groups: php.pear.bot 
Request: Send a blank email to pear-bot+get-49@lists.php.net to get a copy of this message
meebey Sat Aug 21 17:03:17 2004 EDT Modified files: /pearbot/modules bugstats.php Log: - when an error happens, the original error message should be rethrown. http://cvs.php.net/diff.php/pearbot/modules/bugstats.php?r1=1.8&r2=1.9&ty=u Index: pearbot/modules/bugstats.php diff -u pearbot/modules/bugstats.php:1.8 pearbot/modules/bugstats.php:1.9 --- pearbot/modules/bugstats.php:1.8 Sun Jun 27 13:21:42 2004 +++ pearbot/modules/bugstats.php Sat Aug 21 17:03:17 2004 @@ -1,9 +1,9 @@ <?php /** - * $Id: bugstats.php,v 1.8 2004/06/27 17:21:42 meebey Exp $ - * $Revision: 1.8 $ + * $Id: bugstats.php,v 1.9 2004/08/21 21:03:17 meebey Exp $ + * $Revision: 1.9 $ * $Author: meebey $ - * $Date: 2004/06/27 17:21:42 $ + * $Date: 2004/08/21 21:03:17 $ * * Copyright (c) 2004 Tobias Schlitt <toby@php.net> & Mirco Bauer <meebey@php.net> */ @@ -42,6 +42,7 @@ $count = $this->getStats(); if (PEAR::isError($count) || !$count) { $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, $count->getMessage()); + return; } $irc->message(SMARTIRC_TYPE_CHANNEL, $data->channel, $data->nick.': Current bug count is '.$count); $this->updateTopic($irc); @@ -65,8 +66,9 @@ function getStats() { $req =& new HTTP_Request('http://pear.php.net/bugs/lstat.php'); - if (PEAR::isError($req->sendRequest())) { - return PEAR::raiseError('Error fetching bug stats.', 0); + $result = $req->sendRequest(); + if (PEAR::isError($result)) { + return PEAR::raiseError('Error fetching bug stats: '.$result->getMessage(), 0); } return (int)$req->getResponseBody(); }

« previous php.pear.bot (#49) next »