From 4db3d0d9c7625b6d1b521158e7b9e900c667f286 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 15 Sep 2016 00:13:35 +0300 Subject: rendering help using pebble --- juick-www/src/main/java/com/juick/www/Main.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'juick-www/src/main/java/com/juick/www/Main.java') diff --git a/juick-www/src/main/java/com/juick/www/Main.java b/juick-www/src/main/java/com/juick/www/Main.java index fa016edd..57704f36 100644 --- a/juick-www/src/main/java/com/juick/www/Main.java +++ b/juick-www/src/main/java/com/juick/www/Main.java @@ -38,6 +38,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.net.Socket; +import java.net.URISyntaxException; import java.net.URLEncoder; import java.util.Objects; import java.util.Properties; @@ -233,7 +234,15 @@ public class Main extends HttpServlet implements Stream.StreamListener { } else if (uri.equals("/help") || uri.equals("/help/")) { help.doRedirectToHelpIndex(response); } else if (uri.startsWith("/help/")) { - help.doGetHelp(sql, request, response); + try { + help.doGetHelp(sql, request, response); + } catch (PebbleException e) { + log("pebble exception", e); + response.sendError(500); + } catch (URISyntaxException e) { + log("help exception", e); + response.sendError(500); + } } else if (uri.startsWith("/tag/")) { discover.doGet(sql, sqlSearch, request, response); } else if (uri.matches("^/\\d+$")) { -- cgit v1.2.3