Skip to content

Commit ee30fe3

Browse files
bknifflervicary
andauthored
fix(package/gqty): unintended async function (#2035)
* Fix unintended async function causes hard to find issues with uncatchable and unawaited errors * changeset --------- Co-authored-by: Vicary A. <[email protected]>
1 parent 92498f8 commit ee30fe3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/eleven-donkeys-hammer.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'gqty': patch
3+
---
4+
5+
fix(package/gqty): remove async keyword from default error handler

packages/gqty/src/Helpers/fetcher.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const parseResponse = async (response: Response) => {
3030

3131
try {
3232
return JSON.parse(text);
33-
} catch (error) {
33+
} catch {
3434
throw new GQtyError(
3535
`Received malformed JSON response from GraphQL endpoint: ${
3636
text.length > 50 ? text.slice(0, 50) + '...' : text
@@ -59,7 +59,7 @@ export const isExecutionResult = (input: unknown): input is ExecutionResult => {
5959
return 'data' in value || Array.isArray(value.errors);
6060
};
6161

62-
export const handleResponseErrors = async (result: ExecutionResult) => {
62+
export const handleResponseErrors = (result: ExecutionResult) => {
6363
if (result.errors?.length) {
6464
throw GQtyError.fromGraphQLErrors(result.errors);
6565
}

0 commit comments

Comments
 (0)