Skip to content

Commit 0fff882

Browse files
committed
Axios client for EventSource review feedback
1 parent 7dc240c commit 0fff882

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/api-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export function errToStr(error: unknown, def: string) {
1111
} else if (isApiErrorResponse(error)) {
1212
return error.message
1313
} else if (error instanceof ErrorEvent) {
14-
return error.code ? `${error.code}: ${error.message}` : error.message?.toString() || def
14+
return error.code ? `${error.code}: ${error.message || def}` : error.message || def
1515
} else if (typeof error === "string" && error.trim().length > 0) {
1616
return error
1717
}

src/api.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,9 @@ export function createStreamingFetchAdapter(axiosInstance: AxiosInstance) {
127127
},
128128
})
129129

130-
const createReader = () => stream.getReader()
131-
132130
return {
133131
body: {
134-
getReader: () => createReader(),
132+
getReader: () => stream.getReader(),
135133
},
136134
url: urlStr,
137135
status: response.status,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy