Skip to content

Commit

Permalink
fix: change TooManyRequestsError parameter to match new error type pa…
Browse files Browse the repository at this point in the history
…yload
  • Loading branch information
zplata committed Aug 20, 2024
1 parent f115eec commit 19dcc11
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/wrapper/ItemsClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,12 @@ export class Client extends Items {
"X-Fern-Runtime-Version": core.RUNTIME.version,
},
contentType: "application/json",
body: await serializers.CollectionItem.jsonOrThrow(
request, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
skipValidation: true,
},
),
body: await serializers.CollectionItem.jsonOrThrow(request, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
skipValidation: true,
}),
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
});
Expand All @@ -80,7 +78,15 @@ export class Client extends Items {
case 404:
throw new Webflow.NotFoundError(_response.error.body);
case 429:
throw new Webflow.TooManyRequestsError(_response.error.body);
throw new Webflow.TooManyRequestsError(
await serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
skipValidation: true,
breadcrumbsPrefix: ["response"],
})
);
case 500:
throw new Webflow.InternalServerError(_response.error.body);
default:
Expand Down

0 comments on commit 19dcc11

Please sign in to comment.