Skip to content

Commit

Permalink
use try..catch..finally instead of just the await
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedhamidawan committed Nov 16, 2023
1 parent 6bfc33d commit 6795ebb
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions client/src/components/Panels/ToolPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,14 @@ const query = ref("");
const showAdvanced = ref(false);
onMounted(async () => {
await toolStore
.getPanelViews()
.then(async () => {
await initializeTools();
})
.catch((error) => {
console.error(error);
})
.finally(() => {
arePanelsFetched.value = true;
});
try {
await toolStore.getPanelViews();
await initializeTools();
} catch (error) {
console.error(error);
} finally {
arePanelsFetched.value = true;
}
});
watch(
Expand Down

0 comments on commit 6795ebb

Please sign in to comment.