This is an automated email from the ASF dual-hosted git repository.
machristie pushed a commit to branch staging
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git
The following commit(s) were added to refs/heads/staging by this push:
new 2ff4d0c AIRAVATA-3362 Handle missing experiment data dir
2ff4d0c is described below
commit 2ff4d0cc247281ca13ff0b1bca3d4662ea8bd21e
Author: Marcus Christie <[email protected]>
AuthorDate: Thu May 6 10:01:43 2021 -0400
AIRAVATA-3362 Handle missing experiment data dir
---
.../storage/ExperimentStorageViewContainer.vue | 29 ++++++++++++++++++----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git
a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/ExperimentStorageViewContainer.vue
b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/ExperimentStorageViewContainer.vue
index f940102..7241649 100644
---
a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/ExperimentStorageViewContainer.vue
+++
b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/storage/ExperimentStorageViewContainer.vue
@@ -6,11 +6,14 @@
@directory-selected="directorySelected"
:download-in-new-window="true"
></experiment-storage-path-viewer>
+ <b-alert v-else-if="experimentDataDirNotFound" show variant="warning">
+ Experiment Data Directory does not exist in storage.
+ </b-alert>
</b-card>
</template>
<script>
-import { services } from "django-airavata-api";
+import { errors, services, utils } from "django-airavata-api";
import ExperimentStoragePathViewer from "./ExperimentStoragePathViewer.vue";
export default {
@@ -25,6 +28,7 @@ export default {
data() {
return {
experimentStoragePath: null,
+ experimentDataDirNotFound: false,
};
},
components: {
@@ -35,10 +39,25 @@ export default {
},
methods: {
loadExperimentStoragePath(path) {
- return services.ExperimentStoragePathService.get({
- experimentId: this.experimentId,
- path,
- }).then((result) => (this.experimentStoragePath = result));
+ return services.ExperimentStoragePathService.get(
+ {
+ experimentId: this.experimentId,
+ path,
+ },
+ { ignoreErrors: true }
+ )
+ .then((result) => (this.experimentStoragePath = result))
+ .catch((error) => {
+ if (
+ errors.ErrorUtils.isAPIException(error) &&
+ error.details.status === 404
+ ) {
+ this.experimentDataDirNotFound = true;
+ } else {
+ throw error;
+ }
+ })
+ .catch(utils.FetchUtils.reportError);
},
directorySelected(path) {
return this.loadExperimentStoragePath(path);