Skip to content

Commit

Permalink
fix: Fix incorrect Promise structure in customFetch timeout logic (#1652
Browse files Browse the repository at this point in the history
)

Co-authored-by: Chaitanya <[email protected]>
  • Loading branch information
defitricks and ChaituVR authored Dec 17, 2024
1 parent dd197e8 commit 36bd2d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ export function customFetch(
}
throw error;
}),
new Promise(() =>
new Promise((_, reject) =>
setTimeout(() => {
controller.abort();
reject(new Error('API request timeout'));
}, timeout)
)
]);
Expand Down

0 comments on commit 36bd2d7

Please sign in to comment.