Skip to content

Commit 3db6067

Browse files
committed
change error type
1 parent 0318286 commit 3db6067

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/plexus-api/src/api.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,7 @@ export class ApiInstance {
150150
if (this._internalStore.abortOnTimeout) controller.abort()
151151

152152
// if we're throwing, throw an error
153-
if (this._internalStore.throws)
154-
throw new PlexusError('Request timed out', { type: 'api' })
153+
if (this._internalStore.throws) throw new WebTransportError('Request timed out')
155154
// a 504 response status means the programmatic timeout was surpassed
156155
return ApiInstance.createEmptyRes<ResponseDataType>(
157156
timedOut ? 504 : res?.status ?? 513
@@ -314,7 +313,7 @@ export class ApiInstance {
314313
*/
315314
async post<
316315
ResponseType = any,
317-
BodyType extends Record<string, any> | string = {},
316+
BodyType extends Record<string, any> | string = {}
318317
>(
319318
path: string,
320319
body: BodyType = {} as BodyType,
@@ -467,7 +466,7 @@ export class ApiInstance {
467466
setHeaders<
468467
HeaderFunction extends () =>
469468
| Record<string, any>
470-
| Promise<Record<string, any>>,
469+
| Promise<Record<string, any>>
471470
>(inputFnOrObj: HeaderFunction | Record<string, any>) {
472471
// if (!_headers) _internalStore._options.headers = {}
473472
if (this._internalStore.noFetch) return this

0 commit comments

Comments
 (0)