Search in sources :

Example 6 with UserCancelException

use of com.microsoft.identity.common.exception.UserCancelException in project microsoft-authentication-library-common-for-android by AzureAD.

the class ApiEndEvent method putException.

public ApiEndEvent putException(@NonNull final Exception exception) {
    if (exception == null) {
        return this;
    }
    final BaseException adaptedException = ExceptionAdapter.baseExceptionFromException(exception);
    if (adaptedException instanceof UserCancelException) {
        put(Key.USER_CANCEL, Value.TRUE);
    }
    put(Key.SERVER_ERROR_CODE, adaptedException.getCliTelemErrorCode());
    put(Key.SERVER_SUBERROR_CODE, adaptedException.getCliTelemSubErrorCode());
    put(Key.ERROR_CODE, adaptedException.getErrorCode());
    put(Key.SPE_RING, adaptedException.getSpeRing());
    // oii
    put(Key.ERROR_DESCRIPTION, adaptedException.getMessage());
    put(Key.RT_AGE, adaptedException.getRefreshTokenAge());
    put(Key.IS_SUCCESSFUL, Value.FALSE);
    return this;
}
Also used : BaseException(com.microsoft.identity.common.exception.BaseException) UserCancelException(com.microsoft.identity.common.exception.UserCancelException)

Aggregations

UserCancelException (com.microsoft.identity.common.exception.UserCancelException)6 BaseException (com.microsoft.identity.common.exception.BaseException)5 ClientException (com.microsoft.identity.common.exception.ClientException)4 NonNull (androidx.annotation.NonNull)2 ArgumentException (com.microsoft.identity.common.exception.ArgumentException)2 UiRequiredException (com.microsoft.identity.common.exception.UiRequiredException)2 Nullable (androidx.annotation.Nullable)1 BrokerCommunicationException (com.microsoft.identity.common.exception.BrokerCommunicationException)1 DeviceRegistrationRequiredException (com.microsoft.identity.common.exception.DeviceRegistrationRequiredException)1 IntuneAppProtectionPolicyRequiredException (com.microsoft.identity.common.exception.IntuneAppProtectionPolicyRequiredException)1 ServiceException (com.microsoft.identity.common.exception.ServiceException)1 BrokerOperationExecutor (com.microsoft.identity.common.internal.controllers.BrokerOperationExecutor)1 MicrosoftAuthorizationErrorResponse (com.microsoft.identity.common.internal.providers.microsoft.MicrosoftAuthorizationErrorResponse)1 AuthorizationErrorResponse (com.microsoft.identity.common.internal.providers.oauth2.AuthorizationErrorResponse)1 AuthorizationResult (com.microsoft.identity.common.internal.providers.oauth2.AuthorizationResult)1 AcquireTokenResult (com.microsoft.identity.common.internal.result.AcquireTokenResult)1 GzipUtil.compressString (com.microsoft.identity.common.internal.util.GzipUtil.compressString)1 ExecutionException (java.util.concurrent.ExecutionException)1