Do not log stack trace when stopping bot
When stopping a LongPollingBot, no exception should be logged due to closing the socket.
This commit is contained in:
parent
10d0934439
commit
216e910411
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user