Skip to content

Commit

Permalink
Fix error type
Browse files Browse the repository at this point in the history
  • Loading branch information
DonOmalVindula committed Feb 11, 2025
1 parent 8d945df commit 7f08837
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions features/admin.userstores.v1/components/add-user-store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@

import { AppConstants } from "@wso2is/admin.core.v1/constants/app-constants";
import { history } from "@wso2is/admin.core.v1/helpers/history";
import { IdentityAppsApiException } from "@wso2is/core/exceptions";
import { IdentityAppsError } from "@wso2is/core/errors";
import { AlertLevels, TestableComponentInterface } from "@wso2is/core/models";
import { addAlert } from "@wso2is/core/store";
import { FormValue, useTrigger } from "@wso2is/forms";
import { LinkButton, PrimaryButton, Steps, useWizardAlert } from "@wso2is/react-components";
import { AxiosError } from "axios";
import React, { FunctionComponent, ReactElement, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { useDispatch } from "react-redux";
Expand Down Expand Up @@ -127,7 +128,7 @@ export const AddUserStore: FunctionComponent<AddUserStoreProps> = (props: AddUse
onClose();

history.push(AppConstants.getPaths().get("USERSTORES"));
}).catch((error: IdentityAppsApiException) => {
}).catch((error: AxiosError & IdentityAppsError) => {

if (error.response?.status === 403 &&
error.response.data?.code === UserStoreManagementConstants.ERROR_CREATE_LIMIT_REACHED.getErrorCode()) {
Expand All @@ -142,7 +143,7 @@ export const AddUserStore: FunctionComponent<AddUserStoreProps> = (props: AddUse
}

setAlert({
description: error?.name ?? t("userstores:notifications.addUserstore" +
description: error?.description ?? t("userstores:notifications.addUserstore" +
".genericError.description"),
level: AlertLevels.ERROR,
message: error?.message ?? t("userstores:notifications.addUserstore" +
Expand Down

0 comments on commit 7f08837

Please sign in to comment.