Skip to content

Commit

Permalink
Rename exception type
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Melchior committed Jan 29, 2024
1 parent 3f21532 commit 1459146
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class BadFlexibleSyncQueryException internal constructor(message: String)
*
* @see https://www.mongodb.com/docs/atlas/app-services/users/sessions/
*/
public class SyncSessionAuthExpired internal constructor(message: String) :
public class AuthExpiredException internal constructor(message: String) :
SyncException(message)

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import io.realm.kotlin.internal.interop.sync.AppError
import io.realm.kotlin.internal.interop.sync.SyncError
import io.realm.kotlin.mongodb.exceptions.AppException
import io.realm.kotlin.mongodb.exceptions.AuthException
import io.realm.kotlin.mongodb.exceptions.AuthExpiredException
import io.realm.kotlin.mongodb.exceptions.BadFlexibleSyncQueryException
import io.realm.kotlin.mongodb.exceptions.BadRequestException
import io.realm.kotlin.mongodb.exceptions.CompensatingWriteException
Expand All @@ -17,7 +18,6 @@ import io.realm.kotlin.mongodb.exceptions.FunctionExecutionException
import io.realm.kotlin.mongodb.exceptions.InvalidCredentialsException
import io.realm.kotlin.mongodb.exceptions.ServiceException
import io.realm.kotlin.mongodb.exceptions.SyncException
import io.realm.kotlin.mongodb.exceptions.SyncSessionAuthExpired
import io.realm.kotlin.mongodb.exceptions.UnrecoverableSyncException
import io.realm.kotlin.mongodb.exceptions.UserAlreadyConfirmedException
import io.realm.kotlin.mongodb.exceptions.UserAlreadyExistsException
Expand Down Expand Up @@ -80,7 +80,7 @@ internal fun convertSyncError(syncError: SyncError): SyncException {
val errorCode = syncError.errorCode
val message = createMessageFromSyncError(errorCode)
return when (errorCode.errorCode) {
ErrorCode.RLM_ERR_AUTH_ERROR -> SyncSessionAuthExpired(message)
ErrorCode.RLM_ERR_AUTH_ERROR -> AuthExpiredException(message)
ErrorCode.RLM_ERR_WRONG_SYNC_TYPE -> WrongSyncTypeException(message)

ErrorCode.RLM_ERR_INVALID_SUBSCRIPTION_QUERY -> {
Expand Down

0 comments on commit 1459146

Please sign in to comment.