diff --git a/auth0/src/main/java/com/auth0/android/authentication/AuthenticationException.kt b/auth0/src/main/java/com/auth0/android/authentication/AuthenticationException.kt index c0ec9041..1eea076e 100644 --- a/auth0/src/main/java/com/auth0/android/authentication/AuthenticationException.kt +++ b/auth0/src/main/java/com/auth0/android/authentication/AuthenticationException.kt @@ -86,7 +86,7 @@ public class AuthenticationException : Auth0Exception { if (!TextUtils.isEmpty(description)) { return description!! } - return if (UNKNOWN_ERROR == getCode()) { + return if (UNKNOWN_ERROR != getCode()) { String.format("Received error with code %s", getCode()) } else "Failed with unknown error" } diff --git a/auth0/src/test/java/com/auth0/android/authentication/AuthenticationExceptionTest.kt b/auth0/src/test/java/com/auth0/android/authentication/AuthenticationExceptionTest.kt index e1bb2cfb..caa89b3a 100644 --- a/auth0/src/test/java/com/auth0/android/authentication/AuthenticationExceptionTest.kt +++ b/auth0/src/test/java/com/auth0/android/authentication/AuthenticationExceptionTest.kt @@ -134,8 +134,7 @@ public class AuthenticationExceptionTest { CoreMatchers.`is`( CoreMatchers.equalTo( String.format( - "Received error with code %s", - Auth0Exception.UNKNOWN_ERROR + "Failed with unknown error" ) ) ) @@ -150,7 +149,7 @@ public class AuthenticationExceptionTest { ) MatcherAssert.assertThat( ex.getDescription(), - CoreMatchers.`is`(CoreMatchers.equalTo("Failed with unknown error")) + CoreMatchers.`is`(CoreMatchers.equalTo("Received error with code a_valid_code")) ) }