Skip to content

Commit acc680e

Browse files
Feat: Add error handling for test case creation response
1 parent e081232 commit acc680e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/tools/testmanagement-utils/create-testcase.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ export function sanitizeArgs(args: any) {
143143
return cleaned;
144144
}
145145

146+
146147
export async function createTestCase(
147148
params: TestCaseCreateRequest,
148149
): Promise<TestCaseResponse> {
@@ -188,6 +189,12 @@ export async function createTestCase(
188189
},
189190
},
190191
);
192+
193+
// Check if the response indicates success
194+
if (!response.data.data.success) {
195+
throw new Error(`Failed to create test case: ${JSON.stringify(response.data)}`);
196+
}
197+
191198
return response.data;
192199
} catch (error) {
193200
if (error instanceof AxiosError) {
@@ -202,3 +209,4 @@ export async function createTestCase(
202209
throw error;
203210
}
204211
}
212+

0 commit comments

Comments
 (0)