Skip to content

Commit

Permalink
Merge pull request #7 from the-hideout/graphql-yoga
Browse files Browse the repository at this point in the history
don't catch uncaught exceptions
  • Loading branch information
Razzmatazzz authored Aug 9, 2024
2 parents bb5ac7f + 5933049 commit 3cd68b6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions http/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import getEnv from './env-binding.mjs';
const port = process.env.PORT ?? 8788;
const workerCount = parseInt(process.env.WORKERS ?? String(os.cpus().length - 1));

process.on('uncaughtException', (error) => {
console.error({ title: "Uncaught Exception", message: error.stack });
});
/*process.on('uncaughtException', (error) => {
console.error('Uncaught Exception', error.stack);
});*/

if (cluster.isPrimary && workerCount > 0) {
const kvStore = {};
Expand Down
2 changes: 1 addition & 1 deletion index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ async function graphqlHandler(request, env, ctx) {
},
});
if (queryResult.status !== 200) {
throw new Error(`${queryResult.status} ${queryResult.statusText}: ${await queryResult.text()}`);
throw new Error(`${queryResult.status} ${await queryResult.text()}`);
}
console.log('Request served from graphql server');
return new Response(await queryResult.text(), responseOptions);
Expand Down
2 changes: 1 addition & 1 deletion utils/cache-machine.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async function updateCache(env, query, variables, body, ttl = '', specialCache =
}
// Get the cacheKey from the request
query = query.trim();
console.log(`caching response for ${env.ENVIRONMENT} environment`);
console.log(`caching response for ${env.ENVIRONMENT} environment${ttl ? ` for ${ttl} seconds` : ''}`);
const cacheKey = await hash(env.ENVIRONMENT + query + JSON.stringify(variables) + specialCache);

// headers and POST body
Expand Down

0 comments on commit 3cd68b6

Please sign in to comment.