Skip to content

Commit

Permalink
Improved: error handling while parking creation to show error message…
Browse files Browse the repository at this point in the history
… from server (#185)
  • Loading branch information
amansinghbais committed Jul 16, 2024
1 parent 396edc2 commit 2059048
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/CreateVirtualFacilityModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,13 @@ export default defineComponent({
} else {
throw resp.data;
}
} catch (error) {
} catch (error: any) {
logger.error(error)
showToast(translate('Failed to create parking.'))
if(error?.response?.data?.error?.message) {
showToast(error.response.data.error.message)
} else {
showToast(translate('Failed to create parking.'))
}
}
modalController.dismiss()
},
Expand Down

0 comments on commit 2059048

Please sign in to comment.