Skip to content

Commit dc844e3

Browse files
authored
BREAKING CHANGE: updated description of AuthenticationException in case of empty description (#756)
1 parent cea3c17 commit dc844e3

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

auth0/src/main/java/com/auth0/android/authentication/AuthenticationException.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public class AuthenticationException : Auth0Exception {
8686
if (!TextUtils.isEmpty(description)) {
8787
return description!!
8888
}
89-
return if (UNKNOWN_ERROR == getCode()) {
89+
return if (UNKNOWN_ERROR != getCode()) {
9090
String.format("Received error with code %s", getCode())
9191
} else "Failed with unknown error"
9292
}

auth0/src/test/java/com/auth0/android/authentication/AuthenticationExceptionTest.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ public class AuthenticationExceptionTest {
134134
CoreMatchers.`is`(
135135
CoreMatchers.equalTo(
136136
String.format(
137-
"Received error with code %s",
138-
Auth0Exception.UNKNOWN_ERROR
137+
"Failed with unknown error"
139138
)
140139
)
141140
)
@@ -150,7 +149,7 @@ public class AuthenticationExceptionTest {
150149
)
151150
MatcherAssert.assertThat(
152151
ex.getDescription(),
153-
CoreMatchers.`is`(CoreMatchers.equalTo("Failed with unknown error"))
152+
CoreMatchers.`is`(CoreMatchers.equalTo("Received error with code a_valid_code"))
154153
)
155154
}
156155

0 commit comments

Comments
 (0)