From 84c5fd58f99a09b0b3965f02e4c1623b1ac015a4 Mon Sep 17 00:00:00 2001 From: Alex <33497058+bexsoft@users.noreply.github.com> Date: Mon, 29 May 2023 18:05:42 -0600 Subject: [PATCH] Display error snack bar on raw policy edit error (#2841) Signed-off-by: Benjamin Perez --- .../src/screens/Console/Policies/PolicyDetails.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/portal-ui/src/screens/Console/Policies/PolicyDetails.tsx b/portal-ui/src/screens/Console/Policies/PolicyDetails.tsx index 4a25f2e05..632d64e80 100644 --- a/portal-ui/src/screens/Console/Policies/PolicyDetails.tsx +++ b/portal-ui/src/screens/Console/Policies/PolicyDetails.tsx @@ -197,9 +197,17 @@ const PolicyDetails = ({ classes }: IPolicyDetailsProps) => { dispatch(setSnackBarMessage("Policy successfully updated")); refreshPolicyDetails(); }) - .catch((err: ErrorResponseHandler) => { + .catch((err: HttpResponse) => { 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);