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.
2 parents 8ce8e2b + 2482475 commit 017863fCopy full SHA for 017863f
src/index.js
@@ -187,6 +187,17 @@ function ParseServer({
187
188
api.use(middlewares.handleParseErrors);
189
190
+
191
+ process.on('uncaughtException', (err) => {
192
+ if( err.code === "EADDRINUSE" ) { // user-friendly message for this common error
193
+ console.log(`Unable to listen on port ${err.port}. The port is already in use.`);
194
+ process.exit(0);
195
+ }
196
+ else {
197
+ throw err;
198
199
+ });
200
201
return api;
202
}
203
0 commit comments