[vhffs-dev] [2026] removed remaining dangerous die() and exit() from API |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 2026
Author: gradator
Date: 2012-02-19 18:07:44 +0100 (Sun, 19 Feb 2012)
Log Message:
-----------
removed remaining dangerous die() and exit() from API
Modified Paths:
--------------
trunk/vhffs-api/src/Vhffs/Panel/Commons.pm
trunk/vhffs-api/src/Vhffs/Panel/Public.pm
Modified: trunk/vhffs-api/src/Vhffs/Panel/Commons.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Commons.pm 2012-02-19 16:11:44 UTC (rev 2025)
+++ trunk/vhffs-api/src/Vhffs/Panel/Commons.pm 2012-02-19 17:07:44 UTC (rev 2026)
@@ -48,10 +48,9 @@
parameters won't be appended.
=cut
-
sub paginate($$$$$) {
my ($template, $current_page, $total_count, $items_per_page, $url_params) = @_;
- die('Attempted to paginate without pagination template') unless($template->query(name => 'PAGINATION'));
+ return undef unless $template->query(name => 'PAGINATION');
my $max_pages = int( ($total_count + ($items_per_page - 1)) / $items_per_page );
if($max_pages > 1) {
my @params;
@@ -86,7 +85,6 @@
=head2 get_pager
get_pager($current_page, $total, $item_per_page, $url, $url_params)
=cut
-
sub get_pager {
my ($current_page, $total, $ipp, $slider_size, $url, $url_params) = @_;
my $last_page = int( ($total + $ipp - 1 ) / $ipp);
@@ -153,7 +151,6 @@
=back
=cut
-
sub fetch_slice_and_count($$$$$$$;$) {
my ($main, $select, $conditions, $order, $start, $count, $params, $select_callback) = @_;
Modified: trunk/vhffs-api/src/Vhffs/Panel/Public.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Public.pm 2012-02-19 16:11:44 UTC (rev 2025)
+++ trunk/vhffs-api/src/Vhffs/Panel/Public.pm 2012-02-19 17:07:44 UTC (rev 2026)
@@ -142,7 +142,7 @@
$panel->render('common/error.tt', {
message => gettext('No group found')
});
- exit(0);
+ return;
}
my $pager = Vhffs::Panel::Commons::get_pager($page, $count, 10, 5, $panel->{url}, { groupname => $groupname, description => $description, included_tags => \@included_tags_ids, excluded_tags => \@excluded_tags_ids, do => 'groupsearch' });
@@ -185,7 +185,7 @@
$panel->render('common/error.tt', {
message => gettext('CGI Error')
});
- exit(0);
+ return;
}
my $group = Vhffs::Group::get_by_groupname($panel->{vhffs}, $groupname);
@@ -194,7 +194,7 @@
$panel->render('common/error.tt', {
message => gettext('Group not found')
});
- exit(0);
+ return;
}
my $tag_categories = $group->get_tags(Vhffs::Constants::TAG_VISIBILITY_PUBLIC);