Display error snack bar on raw policy edit error (#2841)

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
This commit is contained in:
Alex
2023-05-29 18:05:42 -06:00
committed by GitHub
parent 98979911ee
commit 84c5fd58f9

View File

@@ -197,9 +197,17 @@ const PolicyDetails = ({ classes }: IPolicyDetailsProps) => {
dispatch(setSnackBarMessage("Policy successfully updated"));
refreshPolicyDetails();
})
.catch((err: ErrorResponseHandler) => {
.catch((err: HttpResponse<Policy, Error>) => {
setAddLoading(false);
dispatch(setErrorSnackMessage(err));
dispatch(
setErrorSnackMessage({
errorMessage: "There was an error updating the Policy ",
detailedError:
"There was an error updating the Policy: " +
(err.error.detailedMessage || "") +
". Please check Policy syntax.",
})
);
});
} else {
setAddLoading(false);