Skip to content

Commit

Permalink
error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
diego-m-ob committed Sep 27, 2024
1 parent c04c249 commit a76bc5a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions web/src/views/Wizard/WizardImport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,8 @@
>Import</b-button>
</b-form>
</div>
<div class="panel-heading">
<h5>Import Response</h5>
</div>
<div class="panel-body breakable">
{{ import_response }}
<div v-if="error" class="panel-body text-danger">
Error: {{ error }}
</div>
</div>
</div>
Expand Down Expand Up @@ -64,6 +61,7 @@ export default {
data() {
return {
file: null,
error: null,
};
},
computed: {
Expand Down Expand Up @@ -154,9 +152,13 @@ export default {
*/
async onSubmit(evt) {
evt.preventDefault();
const results = await this.doImport();
this.setDiscoveryModel(JSON.stringify({ discoveryModel: results.discoveryModel }));
this.$router.push('/wizard/discovery-config');
try {
const results = await this.doImport();
this.setDiscoveryModel(JSON.stringify({ discoveryModel: results.discoveryModel }));
this.$router.push('/wizard/discovery-config');
} catch (err) {
this.error = err.error || 'An error occurred during import';
}
},
},
/**
Expand Down

0 comments on commit a76bc5a

Please sign in to comment.