Merge pull request #333 from ng1905/dev

Do not log stack trace when stopping bot
This commit is contained in:
Ruben Bermudez 2017-11-15 18:34:55 +01:00 committed by GitHub
commit 91eaccd8ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,6 +24,7 @@ import org.telegram.telegrambots.logging.BotLogger;
import java.io.IOException;
import java.io.InvalidObjectException;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.nio.charset.StandardCharsets;
import java.security.InvalidParameterException;
@ -259,6 +260,10 @@ public class DefaultBotSession implements BotSession {
BotLogger.severe(responseContent, LOGTAG, e);
}
}
} catch (SocketException e) {
if (!e.getMessage().equals("Socket Closed")) {
BotLogger.severe(LOGTAG, e);
}
} catch (SocketTimeoutException e) {
BotLogger.fine(LOGTAG, e);
} catch (InvalidObjectException | TelegramApiRequestException e) {