Skip to content

Commit 7e36469

Browse files
Fix: Simplify error handling in project and test case creation functions
1 parent 844551a commit 7e36469

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/tools/testmanagement-utils/create-project-folder.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ export async function createProjectOrFolder(
116116
);
117117

118118
if (!res.data.data.success) {
119-
throw new Error(
120-
`Failed to create folder: ${JSON.stringify(res.data)}`,
121-
);
119+
throw new Error(`Failed to create folder: ${JSON.stringify(res.data)}`);
122120
}
123121
// Folder created successfully
124122

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

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

146-
147146
export async function createTestCase(
148147
params: TestCaseCreateRequest,
149148
): Promise<TestCaseResponse> {
@@ -192,7 +191,9 @@ export async function createTestCase(
192191

193192
// Check if the response indicates success
194193
if (!response.data.data.success) {
195-
throw new Error(`Failed to create test case: ${JSON.stringify(response.data)}`);
194+
throw new Error(
195+
`Failed to create test case: ${JSON.stringify(response.data)}`,
196+
);
196197
}
197198

198199
return response.data;
@@ -209,4 +210,3 @@ export async function createTestCase(
209210
throw error;
210211
}
211212
}
212-

0 commit comments

Comments
 (0)