Skip to content

Commit 19dcc11

Browse files
committed
fix: change TooManyRequestsError parameter to match new error type payload
1 parent f115eec commit 19dcc11

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/wrapper/ItemsClient.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,12 @@ export class Client extends Items {
5656
"X-Fern-Runtime-Version": core.RUNTIME.version,
5757
},
5858
contentType: "application/json",
59-
body: await serializers.CollectionItem.jsonOrThrow(
60-
request, {
61-
unrecognizedObjectKeys: "passthrough",
62-
allowUnrecognizedUnionMembers: true,
63-
allowUnrecognizedEnumValues: true,
64-
skipValidation: true,
65-
},
66-
),
59+
body: await serializers.CollectionItem.jsonOrThrow(request, {
60+
unrecognizedObjectKeys: "passthrough",
61+
allowUnrecognizedUnionMembers: true,
62+
allowUnrecognizedEnumValues: true,
63+
skipValidation: true,
64+
}),
6765
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
6866
maxRetries: requestOptions?.maxRetries,
6967
});
@@ -80,7 +78,15 @@ export class Client extends Items {
8078
case 404:
8179
throw new Webflow.NotFoundError(_response.error.body);
8280
case 429:
83-
throw new Webflow.TooManyRequestsError(_response.error.body);
81+
throw new Webflow.TooManyRequestsError(
82+
await serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, {
83+
unrecognizedObjectKeys: "passthrough",
84+
allowUnrecognizedUnionMembers: true,
85+
allowUnrecognizedEnumValues: true,
86+
skipValidation: true,
87+
breadcrumbsPrefix: ["response"],
88+
})
89+
);
8490
case 500:
8591
throw new Webflow.InternalServerError(_response.error.body);
8692
default:

0 commit comments

Comments
 (0)