Skip to content

Commit e72ab28

Browse files
committed
fix: properly execute error interceptors
1 parent 932f905 commit e72ab28

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/custom-client/src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export const createClient = (config: Config = {}): Client => {
147147

148148
for (const fn of interceptors.error.fns) {
149149
if (fn) {
150-
finalError = (await fn(error, response, request, opts)) as string;
150+
finalError = (await fn(finalError, response, request, opts)) as string;
151151
}
152152
}
153153

packages/openapi-ts/src/plugins/@hey-api/client-fetch/bundle/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export const createClient = (config: Config = {}): Client => {
202202

203203
for (const fn of interceptors.error.fns) {
204204
if (fn) {
205-
finalError = (await fn(error, response, request, options as any)) as unknown;
205+
finalError = (await fn(finalError, response, request, options as any)) as unknown;
206206
}
207207
}
208208

packages/openapi-ts/src/plugins/@hey-api/client-ky/bundle/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ export const createClient = (config: Config = {}): Client => {
273273

274274
for (const fn of interceptors.error.fns) {
275275
if (fn) {
276-
finalError = (await fn(error, response, request, options as any)) as string;
276+
finalError = (await fn(finalError, response, request, options as any)) as string;
277277
}
278278
}
279279

packages/openapi-ts/src/plugins/@hey-api/client-next/bundle/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export const createClient = (config: Config = {}): Client => {
189189

190190
for (const fn of interceptors.error.fns) {
191191
if (fn) {
192-
finalError = (await fn(error, response, options as any)) as unknown;
192+
finalError = (await fn(finalError, response, options as any)) as unknown;
193193
}
194194
}
195195

0 commit comments

Comments
 (0)