Skip to content

Commit

Permalink
don't catch uncaught exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Razzmatazzz committed Aug 9, 2024
1 parent ea7f423 commit b25eee8
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 @@ -10,9 +10,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 b25eee8

Please sign in to comment.