File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ export function prettifyErrors(errorResponse) {
5555 "another_key": ["error", "another error"],
5656 }
5757 */
58- if ( errorResponse . response ? .data ?. errors ) {
58+ if ( Object . keys ( errorResponse . response . data ?. errors ) . length > 0 ) {
5959 const prettyHTMLList = [ ] ;
6060 Object . entries ( errorResponse . response . data ?. errors ) . forEach (
6161 ( [ errorField , errorItem ] ) => {
@@ -70,5 +70,20 @@ export function prettifyErrors(errorResponse) {
7070 return < ul > { prettyHTMLList } </ ul > ;
7171 }
7272
73+ // other types of errors
74+ /**
75+ "errors": [
76+ {
77+ "detail": [
78+ "You are not owner or admin of the organization"
79+ ]
80+ }
81+ ]
82+ */
83+ /**
84+ "errors": [
85+ "Config with this parameters already exists"
86+ ]
87+ */
7388 return JSON . stringify ( errorResponse . response ?. data ) ;
7489}
You can’t perform that action at this time.
0 commit comments