From 56a77ed5047ac68a86ad3264fc77ead05b305d38 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Tue, 26 May 2009 20:22:36 -0400 Subject: [PATCH] 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. --- perl-lib/PgCommitFest/Patch.pm | 10 +++++++--- template/error.tt2 | 2 +- template/patch_delete.tt2 | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 template/patch_delete.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

-- 2.39.5