1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-09-20 22:59:32 +02:00

Merge pull request #513 from maniac103/tone-down-roster-error-logging

Conditionally reduce severity of roster reload error logging
This commit is contained in:
Florian Schmaus 2022-02-15 17:01:25 +01:00 committed by GitHub
commit cd70e7aa5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -469,11 +469,14 @@ public final class Roster extends Manager {
@Override @Override
public void processException(Exception exception) { public void processException(Exception exception) {
rosterState = RosterState.uninitialized; rosterState = RosterState.uninitialized;
Level logLevel; Level logLevel = Level.SEVERE;
if (exception instanceof NotConnectedException) { if (exception instanceof NotConnectedException) {
logLevel = Level.FINE; logLevel = Level.FINE;
} else { } else if (exception instanceof XMPPErrorException) {
logLevel = Level.SEVERE; Condition condition = ((XMPPErrorException) exception).getStanzaError().getCondition();
if (condition == Condition.feature_not_implemented || condition == Condition.service_unavailable) {
logLevel = Level.FINE;
}
} }
LOGGER.log(logLevel, "Exception reloading roster", exception); LOGGER.log(logLevel, "Exception reloading roster", exception);
for (RosterLoadedListener listener : rosterLoadedListeners) { for (RosterLoadedListener listener : rosterLoadedListeners) {