File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/tools/testmanagement-utils Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -78,18 +78,18 @@ export async function createProjectOrFolder(
78
78
projId = res . data . project . identifier ;
79
79
} catch ( err ) {
80
80
let text = "Failed to create project." ;
81
-
81
+
82
82
if ( err instanceof AxiosError && err . response ?. data ) {
83
83
const { error } = err . response . data ;
84
84
const status = err . response . status ;
85
-
85
+
86
86
if ( status >= 400 && status < 500 && error ) {
87
87
text = error ;
88
88
}
89
89
} else if ( err instanceof Error ) {
90
90
text = err . message ;
91
91
}
92
-
92
+
93
93
return {
94
94
content : [ { type : "text" , text } ] ,
95
95
isError : true ,
@@ -137,18 +137,18 @@ export async function createProjectOrFolder(
137
137
} ;
138
138
} catch ( err ) {
139
139
let text = "Failed to create folder." ;
140
-
140
+
141
141
if ( err instanceof AxiosError && err . response ?. data ) {
142
142
const { message : apiMessage } = err . response . data ;
143
143
const status = err . response . status ;
144
-
144
+
145
145
if ( status >= 400 && status < 500 && apiMessage ) {
146
146
text = apiMessage ;
147
147
}
148
148
} else if ( err instanceof Error ) {
149
149
text = err . message ;
150
150
}
151
-
151
+
152
152
return {
153
153
content : [ { type : "text" , text } ] ,
154
154
isError : true ,
You can’t perform that action at this time.
0 commit comments