I created this code snippet to simplify the code
async handleAddDevice() {
try {
const modal = await this.modalCtrl.create({
component: CreateEditDevicePage,
});
// if i write some code on this line it is not being called, same goes with modal.present()
this.toastHelper.presentToast({
message: 'before present'
})
modal.present()
} catch (error) {
// this line doesn't get called
this.toastHelper.presentToast({
message: 'catch triggered'
})
} finally {
// this line doesn't get called
this.toastHelper.presentToast({
message: 'try catch ended'
})
}
}
Catch and finally here are not being triggered on android but is working correctly on web, and I am not able to try it on ios
I have this feeling that somewhere inside the create function a promise doesn’t get resolved but not quite sure how.
1 post - 1 participant