fix: Show meaning full error message while creating and email inbox [CW-1312] (#6711)
* chore: Shows error message while creating and email inbox * chore: Review fixes --------- Co-authored-by: Shivam Mishra <scm.mymail@gmail.com>
This commit is contained in:
@@ -63,6 +63,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
channelName: '',
|
channelName: '',
|
||||||
email: '',
|
email: '',
|
||||||
|
alertMessage: '',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -101,9 +102,11 @@ export default {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.showAlert(
|
const errorMessage = error?.message;
|
||||||
this.$t('INBOX_MGMT.ADD.EMAIL_CHANNEL.API.ERROR_MESSAGE')
|
this.alertMessage =
|
||||||
);
|
errorMessage ||
|
||||||
|
this.$t('INBOX_MGMT.ADD.EMAIL_CHANNEL.API.ERROR_MESSAGE');
|
||||||
|
this.showAlert(this.alertMessage);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -157,8 +157,9 @@ export const actions = {
|
|||||||
sendAnalyticsEvent(channel.type);
|
sendAnalyticsEvent(channel.type);
|
||||||
return response.data;
|
return response.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
const errorMessage = error?.response?.data?.message;
|
||||||
commit(types.default.SET_INBOXES_UI_FLAG, { isCreating: false });
|
commit(types.default.SET_INBOXES_UI_FLAG, { isCreating: false });
|
||||||
throw new Error(error);
|
throw new Error(errorMessage);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
createWebsiteChannel: async ({ commit }, params) => {
|
createWebsiteChannel: async ({ commit }, params) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user