From: Robert Haas Date: Wed, 27 May 2009 00:22:36 +0000 (-0400) Subject: Improve error handling in the case where patch_delete fails. X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=56a77ed5047ac68a86ad3264fc77ead05b305d38;p=pgcommitfest.git Improve error handling in the case where patch_delete fails. Per suggestion from Josh Tolley. Along the way, correct a dubious formatting choice in template/error.tt2. --- diff --git a/perl-lib/PgCommitFest/Patch.pm b/perl-lib/PgCommitFest/Patch.pm index b648e4a..3cf1e2a 100644 --- a/perl-lib/PgCommitFest/Patch.pm +++ b/perl-lib/PgCommitFest/Patch.pm @@ -21,11 +21,15 @@ EOM $r->redirect('/action/commitfest_view?id=' . $d->{'commitfest_id'}); } if ($err =~ /patch_comment_patch_id_fkey/) { - $r->error_exit(<error(<error_exit("Internal error: $@"); + else { + $r->error("Internal error: $@"); + } + $r->render_template('patch_delete', { 'id' => $r->cgi_required_id }); } sub form { diff --git a/template/error.tt2 b/template/error.tt2 index 6e538fa..27feb21 100644 --- a/template/error.tt2 +++ b/template/error.tt2 @@ -1,3 +1,3 @@ [% FOREACH one_error_in_list = error_list %] -

[% one_error_in_list | htmlsafe | html_line_break %]

+

[% one_error_in_list | htmlsafe %]

[% END %] diff --git a/template/patch_delete.tt2 b/template/patch_delete.tt2 new file mode 100644 index 0000000..e4868cf --- /dev/null +++ b/template/patch_delete.tt2 @@ -0,0 +1 @@ +

Return to Patch