Skip to content

Commit 84c5fd5

Browse files
authored
Display error snack bar on raw policy edit error (#2841)
Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
1 parent 9897991 commit 84c5fd5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

portal-ui/src/screens/Console/Policies/PolicyDetails.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,17 @@ const PolicyDetails = ({ classes }: IPolicyDetailsProps) => {
197197
dispatch(setSnackBarMessage("Policy successfully updated"));
198198
refreshPolicyDetails();
199199
})
200-
.catch((err: ErrorResponseHandler) => {
200+
.catch((err: HttpResponse<Policy, Error>) => {
201201
setAddLoading(false);
202-
dispatch(setErrorSnackMessage(err));
202+
dispatch(
203+
setErrorSnackMessage({
204+
errorMessage: "There was an error updating the Policy ",
205+
detailedError:
206+
"There was an error updating the Policy: " +
207+
(err.error.detailedMessage || "") +
208+
". Please check Policy syntax.",
209+
})
210+
);
203211
});
204212
} else {
205213
setAddLoading(false);

0 commit comments

Comments
 (0)