We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd54878 commit 2482475Copy full SHA for 2482475
src/index.js
@@ -188,6 +188,17 @@ function ParseServer({
188
189
api.use(middlewares.handleParseErrors);
190
191
+
192
+ process.on('uncaughtException', (err) => {
193
+ if( err.code === "EADDRINUSE" ) { // user-friendly message for this common error
194
+ console.log(`Unable to listen on port ${err.port}. The port is already in use.`);
195
+ process.exit(0);
196
+ }
197
+ else {
198
+ throw err;
199
200
+ });
201
202
return api;
203
}
204
0 commit comments