Skip to content

Commit 70187f8

Browse files
committed
refactor(gateway api): add special error message for GQL timeout PE-6152
1 parent 0b46a9e commit 70187f8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/utils/gateway_api.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ export class GatewayAPI {
8989
}
9090

9191
if (!data.data) {
92+
const isTimeoutError = data.errors?.some((error) =>
93+
error.message.includes('canceling statement due to statement timeout')
94+
);
95+
96+
if (isTimeoutError) {
97+
throw new Error('GQL Query has been timed out.');
98+
}
99+
92100
throw new Error('No data was returned from the GQL request.');
93101
}
94102

0 commit comments

Comments
 (0)