Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-client-next-interceptor-order.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hey-api/openapi-ts": patch
---

**clients**: fix: build URL after request interceptors in `client-next`, and thread `finalError` through error interceptor chains in `client-next`, `client-ky`, and `client-fetch`
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, undefined as any, request, opts)) as unknown;
finalError = (await fn(finalError, undefined as any, request, opts)) as unknown;
}
}

Expand Down Expand Up @@ -223,7 +223,7 @@ export const createClient = (config: Config = {}): Client => {

for (const fn of interceptors.error.fns) {
if (fn) {
finalError = (await fn(error, response, request, opts)) as string;
finalError = (await fn(finalError, response, request, opts)) as string;
}
}

Expand Down
Loading
Loading