From 01e4d74a2b2d47e3dbbfdf0d7e2119bd4e789321 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 14 Jul 2016 12:39:21 +0300 Subject: juick-api: do not die when telegram is not initialized --- juick-api/src/main/java/com/juick/api/TelegramBotHook.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'juick-api/src') diff --git a/juick-api/src/main/java/com/juick/api/TelegramBotHook.java b/juick-api/src/main/java/com/juick/api/TelegramBotHook.java index e1094ff6..f98bbc01 100644 --- a/juick-api/src/main/java/com/juick/api/TelegramBotHook.java +++ b/juick-api/src/main/java/com/juick/api/TelegramBotHook.java @@ -42,8 +42,8 @@ public class TelegramBotHook { public TelegramBotHook(JdbcTemplate jdbc, String token) { this.jdbc = jdbc; bot = TelegramBotAdapter.build(token); - bot.setWebhook("https://api.juick.com/tlgmbtwbhk"); try { + bot.setWebhook("https://api.juick.com/tlgmbtwbhk"); ws = new WebSocketFactory().createSocket("wss://ws.juick.com/_all"); ws.addHeader("Origin", "ws.juick.com"); ws.addHeader("Host", "ws.juick.com"); //TODO: remove from server @@ -115,8 +115,8 @@ public class TelegramBotHook { } }); wsReply.connect(); - } catch (IOException | WebSocketException e) { - logger.log(Level.SEVERE, "couldn't create ws connection", e); + } catch (Exception e) { + logger.log(Level.WARNING, "couldn't initialize telegram bot", e); } } -- cgit v1.2.3