diff --git a/frontend/graphql-codegen.ts b/frontend/graphql-codegen.ts index 41bd209fb7..67c9246928 100644 --- a/frontend/graphql-codegen.ts +++ b/frontend/graphql-codegen.ts @@ -2,7 +2,7 @@ import { CodegenConfig } from '@graphql-codegen/cli' const PUBLIC_API_URL = process.env.PUBLIC_API_URL || 'http://localhost:8000' -export default (async (): Promise => { +export default async function getCodegenConfig(): Promise { let response try { @@ -12,7 +12,7 @@ export default (async (): Promise => { } catch { /* eslint-disable no-console */ console.log('Failed to fetch CSRF token: make sure the backend is running.') - return + throw new Error('Failed to fetch CSRF token: make sure the backend is running.') } if (!response.ok) { @@ -74,4 +74,4 @@ export default (async (): Promise => { }, }, } -})() +}