]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: allow thread generation to EOF on errors
authorEric Wong <e@80x24.org>
Wed, 22 Jun 2016 03:57:33 +0000 (03:57 +0000)
committerEric Wong <e@80x24.org>
Wed, 22 Jun 2016 06:07:00 +0000 (06:07 +0000)
We want to ensure the actual message gets shown, and less
important info does not destroy things.

lib/PublicInbox/View.pm

index 8d2e5424428a953ca74a1a1c157ead60b78f76c0..2b6061aeaaa0655cb621a25c2db686871ff58b5f 100644 (file)
@@ -33,8 +33,13 @@ sub msg_html {
                        $tip . multipart_text_as_html($mime, '') .
                                '</pre><hr />'
                } elsif ($nr == 2) {
-                       '<pre>' . html_footer($hdr, 1, $ctx) .
-                       '</pre>' . msg_reply($ctx, $hdr);
+                       # fake an EOF if generating the footer fails;
+                       # we want to at least show the message if something
+                       # here crashes:
+                       eval {
+                               '<pre>' . html_footer($hdr, 1, $ctx) .
+                               '</pre>' . msg_reply($ctx, $hdr)
+                       };
                } else {
                        undef
                }