Skip to content

Commit 03dea63

Browse files
committed
fix: type errors
1 parent 1822068 commit 03dea63

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/apply.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,10 @@ async function main() {
9393
.map((operation) => {
9494
const { operationId, method, path, requiredParams, hasResponseBody } = operation;
9595
return `async ${operationId}(options${requiredParams ? "" : "?"}: FetchOptions<operations["${operationId}"]>) {
96-
${hasResponseBody ? `const { data } = ` : ``}await this.client.${method}("${path}", options);
96+
const { ${hasResponseBody ? `data, ` : ``}error, response } = await this.client.${method}("${path}", options);
97+
if (error) {
98+
throw new ApiClientError("error calling Atlas API", response, error);
99+
}
97100
${
98101
hasResponseBody
99102
? `return data;

0 commit comments

Comments
 (0)