File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
portal-ui/src/screens/Console/Policies Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ import InputBoxWrapper from "../Common/FormComponents/InputBoxWrapper/InputBoxWr
23
23
import AddPolicyHelpBox from "./AddPolicyHelpBox" ;
24
24
import CodeMirrorWrapper from "../Common/FormComponents/CodeMirrorWrapper/CodeMirrorWrapper" ;
25
25
import { IAM_PAGES } from "../../../common/SecureComponent/permissions" ;
26
- import { ErrorResponseHandler } from "../../../common/types" ;
27
26
import FormLayout from "../Common/FormLayout" ;
28
27
import { setErrorSnackMessage } from "../../../systemSlice" ;
29
28
import { useNavigate } from "react-router-dom" ;
@@ -56,9 +55,17 @@ const AddPolicyScreen = () => {
56
55
setAddLoading ( false ) ;
57
56
navigate ( `${ IAM_PAGES . POLICIES } ` ) ;
58
57
} )
59
- . catch ( ( err : ErrorResponseHandler ) => {
58
+ . catch ( ( err : HttpResponse < Policy , Error > ) => {
60
59
setAddLoading ( false ) ;
61
- dispatch ( setErrorSnackMessage ( err ) ) ;
60
+ dispatch (
61
+ setErrorSnackMessage ( {
62
+ errorMessage : "There was an error creating a Policy " ,
63
+ detailedError :
64
+ "There was an error creating a Policy: " +
65
+ ( err . error . detailedMessage || "" ) +
66
+ ". Please check Policy syntax." ,
67
+ } )
68
+ ) ;
62
69
} ) ;
63
70
} ;
64
71
You can’t perform that action at this time.
0 commit comments