Skip to content

Commit 90da3f9

Browse files
committed
chore: add suggested fix
1 parent 47bfc3e commit 90da3f9

13 files changed

Lines changed: 26 additions & 26 deletions

File tree

examples/openapi-ts-ky/src/client/client/client.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const createClient = (config: Config = {}): Client => {
102102

103103
for (const fn of interceptorsMiddleware.error.fns) {
104104
if (fn) {
105-
finalError = (await fn(error, response, request, opts)) as string;
105+
finalError = (await fn(finalError, response, request, opts)) as string;
106106
}
107107
}
108108

@@ -285,7 +285,7 @@ export const createClient = (config: Config = {}): Client => {
285285
// error may already be processed by parseErrorResponse, in this case
286286
// we can skip running interceptors again
287287
if (!errorInterceptorsInvoked) {
288-
// parseErrorResponse already ran interceptors and threw (throwOnError=true); just re-throw
288+
// run error interceptors for errors not already handled by parseErrorResponse
289289
for (const fn of interceptors.error.fns) {
290290
if (fn) {
291291
finalError = await fn(finalError, response, request, options as ResolvedRequestOptions);

packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-false/client/client.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const createClient = (config: Config = {}): Client => {
102102

103103
for (const fn of interceptorsMiddleware.error.fns) {
104104
if (fn) {
105-
finalError = (await fn(error, response, request, opts)) as string;
105+
finalError = (await fn(finalError, response, request, opts)) as string;
106106
}
107107
}
108108

@@ -285,7 +285,7 @@ export const createClient = (config: Config = {}): Client => {
285285
// error may already be processed by parseErrorResponse, in this case
286286
// we can skip running interceptors again
287287
if (!errorInterceptorsInvoked) {
288-
// parseErrorResponse already ran interceptors and threw (throwOnError=true); just re-throw
288+
// run error interceptors for errors not already handled by parseErrorResponse
289289
for (const fn of interceptors.error.fns) {
290290
if (fn) {
291291
finalError = await fn(finalError, response, request, options as ResolvedRequestOptions);

packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-number/client/client.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const createClient = (config: Config = {}): Client => {
102102

103103
for (const fn of interceptorsMiddleware.error.fns) {
104104
if (fn) {
105-
finalError = (await fn(error, response, request, opts)) as string;
105+
finalError = (await fn(finalError, response, request, opts)) as string;
106106
}
107107
}
108108

@@ -285,7 +285,7 @@ export const createClient = (config: Config = {}): Client => {
285285
// error may already be processed by parseErrorResponse, in this case
286286
// we can skip running interceptors again
287287
if (!errorInterceptorsInvoked) {
288-
// parseErrorResponse already ran interceptors and threw (throwOnError=true); just re-throw
288+
// run error interceptors for errors not already handled by parseErrorResponse
289289
for (const fn of interceptors.error.fns) {
290290
if (fn) {
291291
finalError = await fn(finalError, response, request, options as ResolvedRequestOptions);

packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-strict/client/client.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const createClient = (config: Config = {}): Client => {
102102

103103
for (const fn of interceptorsMiddleware.error.fns) {
104104
if (fn) {
105-
finalError = (await fn(error, response, request, opts)) as string;
105+
finalError = (await fn(finalError, response, request, opts)) as string;
106106
}
107107
}
108108

@@ -285,7 +285,7 @@ export const createClient = (config: Config = {}): Client => {
285285
// error may already be processed by parseErrorResponse, in this case
286286
// we can skip running interceptors again
287287
if (!errorInterceptorsInvoked) {
288-
// parseErrorResponse already ran interceptors and threw (throwOnError=true); just re-throw
288+
// run error interceptors for errors not already handled by parseErrorResponse
289289
for (const fn of interceptors.error.fns) {
290290
if (fn) {
291291
finalError = await fn(finalError, response, request, options as ResolvedRequestOptions);

packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/base-url-string/client/client.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const createClient = (config: Config = {}): Client => {
102102

103103
for (const fn of interceptorsMiddleware.error.fns) {
104104
if (fn) {
105-
finalError = (await fn(error, response, request, opts)) as string;
105+
finalError = (await fn(finalError, response, request, opts)) as string;
106106
}
107107
}
108108

@@ -285,7 +285,7 @@ export const createClient = (config: Config = {}): Client => {
285285
// error may already be processed by parseErrorResponse, in this case
286286
// we can skip running interceptors again
287287
if (!errorInterceptorsInvoked) {
288-
// parseErrorResponse already ran interceptors and threw (throwOnError=true); just re-throw
288+
// run error interceptors for errors not already handled by parseErrorResponse
289289
for (const fn of interceptors.error.fns) {
290290
if (fn) {
291291
finalError = await fn(finalError, response, request, options as ResolvedRequestOptions);

packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/clean-false/client/client.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const createClient = (config: Config = {}): Client => {
102102

103103
for (const fn of interceptorsMiddleware.error.fns) {
104104
if (fn) {
105-
finalError = (await fn(error, response, request, opts)) as string;
105+
finalError = (await fn(finalError, response, request, opts)) as string;
106106
}
107107
}
108108

@@ -285,7 +285,7 @@ export const createClient = (config: Config = {}): Client => {
285285
// error may already be processed by parseErrorResponse, in this case
286286
// we can skip running interceptors again
287287
if (!errorInterceptorsInvoked) {
288-
// parseErrorResponse already ran interceptors and threw (throwOnError=true); just re-throw
288+
// run error interceptors for errors not already handled by parseErrorResponse
289289
for (const fn of interceptors.error.fns) {
290290
if (fn) {
291291
finalError = await fn(finalError, response, request, options as ResolvedRequestOptions);

packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/default/client/client.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const createClient = (config: Config = {}): Client => {
102102

103103
for (const fn of interceptorsMiddleware.error.fns) {
104104
if (fn) {
105-
finalError = (await fn(error, response, request, opts)) as string;
105+
finalError = (await fn(finalError, response, request, opts)) as string;
106106
}
107107
}
108108

@@ -285,7 +285,7 @@ export const createClient = (config: Config = {}): Client => {
285285
// error may already be processed by parseErrorResponse, in this case
286286
// we can skip running interceptors again
287287
if (!errorInterceptorsInvoked) {
288-
// parseErrorResponse already ran interceptors and threw (throwOnError=true); just re-throw
288+
// run error interceptors for errors not already handled by parseErrorResponse
289289
for (const fn of interceptors.error.fns) {
290290
if (fn) {
291291
finalError = await fn(finalError, response, request, options as ResolvedRequestOptions);

packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/import-file-extension-ts/client/client.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const createClient = (config: Config = {}): Client => {
102102

103103
for (const fn of interceptorsMiddleware.error.fns) {
104104
if (fn) {
105-
finalError = (await fn(error, response, request, opts)) as string;
105+
finalError = (await fn(finalError, response, request, opts)) as string;
106106
}
107107
}
108108

@@ -285,7 +285,7 @@ export const createClient = (config: Config = {}): Client => {
285285
// error may already be processed by parseErrorResponse, in this case
286286
// we can skip running interceptors again
287287
if (!errorInterceptorsInvoked) {
288-
// parseErrorResponse already ran interceptors and threw (throwOnError=true); just re-throw
288+
// run error interceptors for errors not already handled by parseErrorResponse
289289
for (const fn of interceptors.error.fns) {
290290
if (fn) {
291291
finalError = await fn(finalError, response, request, options as ResolvedRequestOptions);

packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-optional/client/client.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const createClient = (config: Config = {}): Client => {
102102

103103
for (const fn of interceptorsMiddleware.error.fns) {
104104
if (fn) {
105-
finalError = (await fn(error, response, request, opts)) as string;
105+
finalError = (await fn(finalError, response, request, opts)) as string;
106106
}
107107
}
108108

@@ -285,7 +285,7 @@ export const createClient = (config: Config = {}): Client => {
285285
// error may already be processed by parseErrorResponse, in this case
286286
// we can skip running interceptors again
287287
if (!errorInterceptorsInvoked) {
288-
// parseErrorResponse already ran interceptors and threw (throwOnError=true); just re-throw
288+
// run error interceptors for errors not already handled by parseErrorResponse
289289
for (const fn of interceptors.error.fns) {
290290
if (fn) {
291291
finalError = await fn(finalError, response, request, options as ResolvedRequestOptions);

packages/openapi-ts-tests/main/test/__snapshots__/3.1.x/clients/@hey-api/client-ky/sdk-client-required/client/client.gen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const createClient = (config: Config = {}): Client => {
102102

103103
for (const fn of interceptorsMiddleware.error.fns) {
104104
if (fn) {
105-
finalError = (await fn(error, response, request, opts)) as string;
105+
finalError = (await fn(finalError, response, request, opts)) as string;
106106
}
107107
}
108108

@@ -285,7 +285,7 @@ export const createClient = (config: Config = {}): Client => {
285285
// error may already be processed by parseErrorResponse, in this case
286286
// we can skip running interceptors again
287287
if (!errorInterceptorsInvoked) {
288-
// parseErrorResponse already ran interceptors and threw (throwOnError=true); just re-throw
288+
// run error interceptors for errors not already handled by parseErrorResponse
289289
for (const fn of interceptors.error.fns) {
290290
if (fn) {
291291
finalError = await fn(finalError, response, request, options as ResolvedRequestOptions);

0 commit comments

Comments
 (0)