Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxcapades committed May 17, 2024
1 parent 911dfb6 commit 2e2559f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package vdi.component.reinstaller
import kotlinx.coroutines.sync.Mutex
import org.slf4j.LoggerFactory
import org.veupathdb.lib.s3.s34k.S3Api
import org.veupathdb.lib.s3.s34k.errors.S34KError
import org.veupathdb.vdi.lib.common.compression.Zip
import org.veupathdb.vdi.lib.common.field.ProjectID
import org.veupathdb.vdi.lib.common.fs.TempFiles
Expand Down Expand Up @@ -171,6 +172,8 @@ object DatasetReinstaller {

val response = try {
withInstallBundle(directory) { handler.client.postInstallData(dataset.datasetID, projectID, it) }
} catch (e: S34KError) { // don't mix up minio errors with request errors
throw PluginException.installData(handler.displayName, projectID, dataset.owner, dataset.datasetID, cause = e)
} catch (e: Throwable) {
throw PluginRequestException.installData(handler.displayName, projectID, dataset.owner, dataset.datasetID, cause = e)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import kotlinx.coroutines.launch
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import org.apache.logging.log4j.kotlin.logger
import org.veupathdb.lib.s3.s34k.errors.S34KError
import org.veupathdb.vdi.lib.common.DatasetManifestFilename
import org.veupathdb.vdi.lib.common.DatasetMetaFilename
import org.veupathdb.vdi.lib.common.OriginTimestamp
Expand Down Expand Up @@ -193,6 +194,8 @@ internal class ImportTriggerHandlerImpl(private val config: ImportTriggerHandler
datasetDir.getImportReadyFile()
.loadContents()!!
.use { handler.client.postImport(datasetID, meta, it) }
} catch (e: S34KError) { // don't mix up minio errors with request errors
throw PluginException.import(handler.displayName, userID, datasetID, cause = e)
} catch (e: Throwable) {
throw PluginRequestException.import(handler.displayName, userID, datasetID, cause = e)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.launch
import org.slf4j.LoggerFactory
import org.veupathdb.lib.s3.s34k.errors.S34KError
import org.veupathdb.vdi.lib.common.compression.Zip
import org.veupathdb.vdi.lib.common.field.DatasetID
import org.veupathdb.vdi.lib.common.field.ProjectID
Expand Down Expand Up @@ -301,6 +302,8 @@ internal class InstallDataTriggerHandlerImpl(private val config: InstallTriggerH
// RECREATING IT FOR EACH TARGET.
val response = try {
withInstallBundle(s3Dir) { handler.client.postInstallData(datasetID, projectID, it) }
} catch (e: S34KError) { // Don't mix up minio errors with request errors.
throw PluginException.installData(handler.displayName, projectID, userID, datasetID, cause = e)
} catch (e: Throwable) {
throw PluginRequestException.installData(handler.displayName, projectID, userID, datasetID, cause = e)
}
Expand Down

0 comments on commit 2e2559f

Please sign in to comment.