Skip to content

Commit fd9d872

Browse files
committed
fix: Catch unhandled rejections on server starts
1 parent f43edb3 commit fd9d872

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

packages/cubejs-cli/templates.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ const server = new CubejsServer();
44
55
server.listen().then(({ port }) => {
66
console.log(\`🚀 Cube.js server is listening on \${port}\`);
7+
}).catch(e => {
8+
console.error('Fatal error during server start: ');
9+
console.error(e.stack || e);
710
});
811
`;
912

packages/cubejs-server/bin/dev-server.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@ const server = new CubejsServer();
55

66
server.listen().then(({ port }) => {
77
console.log(`🚀 Cube.js server is listening on ${port}`);
8+
}).catch(e => {
9+
console.error('Fatal error during server start: ');
10+
console.error(e.stack || e);
811
});

0 commit comments

Comments
 (0)