diff options
author | Vitaly Takmazov | 2016-09-15 00:13:35 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-09-15 00:13:35 +0300 |
commit | 4db3d0d9c7625b6d1b521158e7b9e900c667f286 (patch) | |
tree | eb374abaeb62e2fdf3bbd7d0d6fa38463e631e5f /juick-www/src/main/java/com/juick/www/Main.java | |
parent | 5a14a313d6bc70f821e1bd513d025109a5c15906 (diff) |
rendering help using pebble
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/Main.java')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/Main.java | 11 |
1 files changed, 10 insertions, 1 deletions
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+$")) { |