aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-07-14 12:39:21 +0300
committerGravatar Vitaly Takmazov2016-07-14 12:39:21 +0300
commit01e4d74a2b2d47e3dbbfdf0d7e2119bd4e789321 (patch)
tree30d65889bd80a1ab75f8cf2124c27dd5b762a913 /juick-api/src/main
parent7fbaabbc4a46a0fc739fa3be4252d24c1c26ff2b (diff)
juick-api: do not die when telegram is not initialized
Diffstat (limited to 'juick-api/src/main')
-rw-r--r--juick-api/src/main/java/com/juick/api/TelegramBotHook.java6
1 files changed, 3 insertions, 3 deletions
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);
}
}