public interface OnProfileEditCallback
Modifier and Type | Method and Description |
---|---|
void |
onError(java.lang.Exception ex)
Callback when an error occurred.
|
void |
onSuccess() |
void onSuccess()
void onError(java.lang.Exception ex)
UserKitException
,
it will contain meaningful information that helps you react with this error.
@Override
public void onError(Exception ex) {
if (ex instanceOf UserKitException) {
UserKitException ukException = (UserKitException) ex;
// check if server caused this error or not
if (!ukException.isInternalServerError() {
// you have invalid request, check reason why:
switch(ex.getErrorCode()) {
case ErrorCode.INVALID_TOKEN:
//....
}
}
} else {
// may be connect error.
}
}
ex
- instance of UserKitException
if server responded error, otherwise it may be
happened while connecting to server.ErrorCode
,
UserKitException.getErrorCode()
,
UserKitException.getMessage()