diff --git a/frontend/src/graphql.ts b/frontend/src/graphql.ts index 9f9c2638c..6788f2898 100644 --- a/frontend/src/graphql.ts +++ b/frontend/src/graphql.ts @@ -35,7 +35,6 @@ export const graphqlRequest = async ({ variables, signal, }: RequestOptions): Promise => { - const stack = new Error().stack; let response: Response; try { response = await fetch(graphqlEndpoint, { @@ -50,15 +49,15 @@ export const graphqlRequest = async ({ signal, }); } catch (cause) { - const e = new Error(`GraphQL to ${graphqlEndpoint} request failed`, { + throw new Error(`GraphQL request to ${graphqlEndpoint} request failed`, { cause, }); - e.stack = stack; - throw e; } if (!response.ok) { - throw new Error(`GraphQL request failed: ${response.status}`); + throw new Error( + `GraphQL request to ${graphqlEndpoint} failed: ${response.status}`, + ); } const json: ExecutionResult = await response.json(); @@ -67,7 +66,7 @@ export const graphqlRequest = async ({ } if (!json.data) { - throw new Error("GraphQL request returned no data"); + throw new Error(`GraphQL request to ${graphqlEndpoint} returned no data`); } return json.data; diff --git a/frontend/tests/routes/render.tsx b/frontend/tests/routes/render.tsx index 93e886066..8e8402f7c 100644 --- a/frontend/tests/routes/render.tsx +++ b/frontend/tests/routes/render.tsx @@ -15,8 +15,6 @@ import { afterAll, afterEach, beforeAll } from "vitest"; import { routeTree } from "../../src/routeTree.gen"; import { handlers } from "../mocks/handlers"; -// Create a new router instance - export const server = setupServer(...handlers); // Start server before all tests