diff --git a/lib/node-router.js b/lib/node-router.js index 601f2e1..ee3167e 100644 --- a/lib/node-router.js +++ b/lib/node-router.js @@ -67,6 +67,15 @@ exports.getServer = function getServer(logger) { var routes = []; + process.on('uncaughtException', function(e, sock) { + if (e.code === 'EACCES' && e.syscall === 'listen') { + console.log("\nError 'EACCES' raised. If using port <= 1024, use sudo or execute as root.\n"); + } + else { + console.log('Uncaught Exception raised: ', e); + } + }); + // Adds a route the the current server function addRoute(method, pattern, handler, format) { if (typeof pattern === 'string') {