File tree Expand file tree Collapse file tree 5 files changed +10
-10
lines changed
main/java/com/auth0/android/authentication/storage
test/java/com/auth0/android/authentication/storage Expand file tree Collapse file tree 5 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -329,7 +329,7 @@ public class CredentialsManager @VisibleForTesting(otherwise = VisibleForTesting
329329 error.isRefreshTokenDeleted ||
330330 error.isInvalidRefreshToken -> CredentialsManagerException .Code .RENEW_FAILED
331331 error.isNetworkError -> CredentialsManagerException .Code .NO_NETWORK
332- else -> CredentialsManagerException .Code .SERVER_ERROR
332+ else -> CredentialsManagerException .Code .API_ERROR
333333 }
334334 callback.onFailure(
335335 CredentialsManagerException (
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ public class CredentialsManagerException :
4444 BIOMETRICS_INVALID_USER ,
4545 BIOMETRIC_AUTHENTICATION_FAILED ,
4646 NO_NETWORK ,
47- SERVER_ERROR
47+ API_ERROR
4848 }
4949
5050 private var code: Code ?
@@ -140,8 +140,8 @@ public class CredentialsManagerException :
140140 // Exceptions thrown when making api calls for access token renewal
141141 public val NO_NETWORK : CredentialsManagerException =
142142 CredentialsManagerException (Code .NO_NETWORK )
143- public val SERVER_ERROR : CredentialsManagerException =
144- CredentialsManagerException (Code .SERVER_ERROR )
143+ public val API_ERROR : CredentialsManagerException =
144+ CredentialsManagerException (Code .API_ERROR )
145145
146146
147147 private fun getMessage (code : Code ): String {
@@ -186,7 +186,7 @@ public class CredentialsManagerException :
186186 Code .BIOMETRICS_INVALID_USER -> " The user didn't pass the authentication challenge."
187187 Code .BIOMETRIC_AUTHENTICATION_FAILED -> " Biometric authentication failed."
188188 Code .NO_NETWORK -> " Failed to execute the network request."
189- Code .SERVER_ERROR -> " An error occurred when trying to authenticate with the server ."
189+ Code .API_ERROR -> " An error occurred while processing the request ."
190190 }
191191 }
192192 }
Original file line number Diff line number Diff line change @@ -590,7 +590,7 @@ public class SecureCredentialsManager @VisibleForTesting(otherwise = VisibleForT
590590 error.isRefreshTokenDeleted ||
591591 error.isInvalidRefreshToken -> CredentialsManagerException .Code .RENEW_FAILED
592592 error.isNetworkError -> CredentialsManagerException .Code .NO_NETWORK
593- else -> CredentialsManagerException .Code .SERVER_ERROR
593+ else -> CredentialsManagerException .Code .API_ERROR
594594 }
595595 callback.onFailure(
596596 CredentialsManagerException (
Original file line number Diff line number Diff line change @@ -916,7 +916,7 @@ public class CredentialsManagerTest {
916916 }
917917
918918 @Test
919- public fun shouldGetAndFailToRenewExpiredCredentialsWhenServerErrorOccurs () {
919+ public fun shouldGetAndFailToRenewExpiredCredentialsWhenApiErrorOccurs () {
920920 Mockito .`when `(storage.retrieveString(" com.auth0.id_token" )).thenReturn(" idToken" )
921921 Mockito .`when `(storage.retrieveString(" com.auth0.access_token" )).thenReturn(" accessToken" )
922922 Mockito .`when `(storage.retrieveString(" com.auth0.refresh_token" )).thenReturn(" refreshToken" )
@@ -950,7 +950,7 @@ public class CredentialsManagerTest {
950950 MatcherAssert .assertThat(exception.cause, Is .`is `(authenticationException))
951951 MatcherAssert .assertThat(
952952 exception.message,
953- Is .`is `(" An error occurred when trying to authenticate with the server ." )
953+ Is .`is `(" An error occurred while processing the request ." )
954954 )
955955 }
956956
Original file line number Diff line number Diff line change @@ -1375,7 +1375,7 @@ public class SecureCredentialsManagerTest {
13751375 }
13761376
13771377 @Test
1378- public fun shouldGetAndFailToRenewExpiredCredentialsWhenServerErrorOccurs () {
1378+ public fun shouldGetAndFailToRenewExpiredCredentialsWhenApiErrorOccurs () {
13791379 Mockito .`when `(localAuthenticationManager.authenticate()).then {
13801380 localAuthenticationManager.resultCallback.onSuccess(true )
13811381 }
@@ -1406,7 +1406,7 @@ public class SecureCredentialsManagerTest {
14061406 MatcherAssert .assertThat(exception.cause, Is .`is `(authenticationException))
14071407 MatcherAssert .assertThat(
14081408 exception.message,
1409- Is .`is `(" An error occurred when trying to authenticate with the server ." )
1409+ Is .`is `(" An error occurred while processing the request ." )
14101410 )
14111411 }
14121412
You can’t perform that action at this time.
0 commit comments