Skip to content

Commit

Permalink
refactor: A little refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
sirambd committed Oct 23, 2024
1 parent dd9d796 commit e2d4cac
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import com.infomaniak.multiplatform_swisstransfer.common.exceptions.UnknownExcep
import com.infomaniak.multiplatform_swisstransfer.common.interfaces.upload.UploadSession
import com.infomaniak.multiplatform_swisstransfer.data.NewUploadSession
import com.infomaniak.multiplatform_swisstransfer.database.controllers.UploadController
import com.infomaniak.multiplatform_swisstransfer.exceptions.NullPropertyException
import com.infomaniak.multiplatform_swisstransfer.exceptions.NotFoundException
import com.infomaniak.multiplatform_swisstransfer.exceptions.NullPropertyException
import com.infomaniak.multiplatform_swisstransfer.network.exceptions.ApiException
import com.infomaniak.multiplatform_swisstransfer.network.exceptions.ContainerErrorsException
import com.infomaniak.multiplatform_swisstransfer.network.exceptions.NetworkException
Expand Down Expand Up @@ -171,8 +171,10 @@ class UploadManager(
): Unit = withContext(Dispatchers.IO) {
val uploadSession = uploadController.getUploadByUUID(uuid)
?: throw NotFoundException("${UploadSession::class.simpleName} not found in DB with uuid = $uuid")
val remoteUploadHost = uploadSession.remoteUploadHost ?: throw NullPropertyException("Remote upload host cannot be null")
val remoteContainer = uploadSession.remoteContainer ?: throw NullPropertyException("Remote container cannot be null")
val remoteUploadHost = uploadSession.remoteUploadHost
?: throw NullPropertyException("Remote upload host cannot be null")
val remoteContainer = uploadSession.remoteContainer
?: throw NullPropertyException("Remote container cannot be null")

uploadRepository.uploadChunk(
uploadHost = remoteUploadHost,
Expand Down

0 comments on commit e2d4cac

Please sign in to comment.