use addError so we see the message (#20420)

fixes: #20401
This commit is contained in:
Erik Jan de Wit 2023-05-18 08:34:11 +02:00 committed by GitHub
parent c30b234bbb
commit 9943c977de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,7 +36,7 @@ export default function AddSamlConnect() {
formState: { isDirty },
} = form;
const { addAlert } = useAlerts();
const { addAlert, addError } = useAlerts();
const { realm } = useRealm();
const onSubmit = async (provider: DiscoveryIdentityProvider) => {
@ -56,12 +56,7 @@ export default function AddSamlConnect() {
})
);
} catch (error: any) {
addAlert(
t("createError", {
error: error.response?.data?.errorMessage || error,
}),
AlertVariant.danger
);
addError("identity-providers:createError", error);
}
};