From 55e27c1167c9e903b1675f0b63aaf2033f575af0 Mon Sep 17 00:00:00 2001 From: galimru Date: Mon, 27 Jan 2020 21:15:04 +0400 Subject: [PATCH] added the fix to workaround openjdk bug which thrown internal error (ref #629) --- .../telegrambots/updatesreceivers/DefaultBotSession.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/telegrambots/src/main/java/org/telegram/telegrambots/updatesreceivers/DefaultBotSession.java b/telegrambots/src/main/java/org/telegram/telegrambots/updatesreceivers/DefaultBotSession.java index 0f9f6334..94e83313 100644 --- a/telegrambots/src/main/java/org/telegram/telegrambots/updatesreceivers/DefaultBotSession.java +++ b/telegrambots/src/main/java/org/telegram/telegrambots/updatesreceivers/DefaultBotSession.java @@ -274,6 +274,14 @@ public class DefaultBotSession implements BotSession { } catch (InterruptedException e) { log.info(e.getLocalizedMessage(), e); interrupt(); + } catch (InternalError e) { + // handle InternalError to workaround OpenJDK bug (resolved since 13.0) + // https://bugs.openjdk.java.net/browse/JDK-8173620 + Throwable cause = e.getCause(); + if (cause instanceof IOException) { + log.error(e.getLocalizedMessage(), e); + } + throw e; } return Collections.emptyList(); }