Update error-handling, show underprivileged notification error

This commit is contained in:
Tuan Dang
2023-11-27 15:50:00 +07:00
parent 6579b3c93f
commit 814b71052d
6 changed files with 18 additions and 8 deletions
@@ -236,9 +236,12 @@ export const AddMachineIdentityModal = ({
reset();
} catch (err) {
console.error(err);
const error = err as any;
const text = error?.response?.data?.message
?? `Failed to ${popUp?.machineIdentity?.data ? "updated" : "created"} machine identity`;
createNotification({
text: `Failed to ${popUp?.machineIdentity?.data ? "updated" : "created"} machine identity`,
text,
type: "error"
});
}