1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-25 21:42:07 +01:00

Add "Roster loading failed" callback

This commit is contained in:
Florian Schmaus 2015-12-09 10:49:15 +01:00
parent 45feaecdf7
commit feff081547
2 changed files with 16 additions and 0 deletions

View file

@ -404,6 +404,9 @@ public final class Roster extends Manager {
logLevel = Level.SEVERE;
}
LOGGER.log(logLevel, "Exception reloading roster" , exception);
for (RosterLoadedListener listener : rosterLoadedListeners) {
listener.onRosterLoadingFailed(exception);
}
}
});
}

View file

@ -35,4 +35,17 @@ public interface RosterLoadedListener {
*/
public void onRosterLoaded(Roster roster);
/**
* Called when roster loading has failed.
* <p>
* Note that the reason for the failure could be as trivial as the connection being not
* connected, in which case the exception will be a
* {@link org.jivesoftware.smack.SmackException.NotConnectedException}.
* </p>
*
* @param exception the exception which caused the failure.
* @since 4.2
*/
public void onRosterLoadingFailed(Exception exception);
}