Skip to content

Commit

Permalink
Raise exceptions, not errors
Browse files Browse the repository at this point in the history
  • Loading branch information
CloCkWeRX committed Jun 22, 2014
1 parent 298a489 commit 6d72dd7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions include/Damblan/Trackback.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,10 @@ function listTrackbacks(&$dbh, $id, $approvedOnly = true, $orderBy = 'timestamp
function recentTrackbacks(&$dbh, $offset = 0, $number = 10, $approvedOnly = true, $unapprovedOnly = false)
{
if ($offset < 0) {
return PEAR::raiseError('Offset out of range. Offset must be integer >= 0.');
throw new InvalidArgumentException('Offset out of range. Offset must be integer >= 0.');
}
if (($number < 1) || ($number > 50)) {
return PEAR::raiseError('Number out of range. Number must be integer between 1 and 50.');
throw new InvalidArgumentException('Number out of range. Number must be integer between 1 and 50.');
}
$sql = 'SELECT id, title, excerpt, blog_name, url, timestamp, approved, ip
FROM trackbacks';
Expand Down Expand Up @@ -424,5 +424,3 @@ function compareWords($source, $element)
return (strpos(strtolower(html_entity_decode($element)), strtolower($source)));
}
}

?>

0 comments on commit 6d72dd7

Please sign in to comment.