fix: show backend error message on API channel creation failure (#13855)

This commit is contained in:
Shivam Mishra
2026-03-27 11:42:33 +05:30
committed by GitHub
parent 5d9d754961
commit 127ac0a6b2
2 changed files with 5 additions and 3 deletions

View File

@@ -57,7 +57,10 @@ export default {
},
});
} catch (error) {
useAlert(this.$t('INBOX_MGMT.ADD.API_CHANNEL.API.ERROR_MESSAGE'));
useAlert(
error.message ||
this.$t('INBOX_MGMT.ADD.API_CHANNEL.API.ERROR_MESSAGE')
);
}
},
},

View File

@@ -220,9 +220,8 @@ export const actions = {
sendAnalyticsEvent(channel.type);
return response.data;
} catch (error) {
const errorMessage = error?.response?.data?.message;
commit(types.default.SET_INBOXES_UI_FLAG, { isCreating: false });
throw new Error(errorMessage);
return throwErrorMessage(error);
}
},
createWebsiteChannel: async ({ commit }, params) => {