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 82febc2 commit 63ffa74
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
.fetchPanelViews()
.then(async () => {
await initializeTools();
})
.catch((error) => {
console.error(error);
})
.finally(() => {
arePanelsFetched.value = true;
});
try {
await toolStore.fetchPanelViews();
await initializeTools();
} catch (error) {
console.error(error);
} finally {
arePanelsFetched.value = true;
}
});
watch(
Expand Down

0 comments on commit 63ffa74

Please sign in to comment.