diff --git a/support/aphlict/server/aphlict_server.js b/support/aphlict/server/aphlict_server.js index f079a059bd..f6dd53dbf9 100644 --- a/support/aphlict/server/aphlict_server.js +++ b/support/aphlict/server/aphlict_server.js @@ -177,9 +177,18 @@ var receive_server = http.createServer(function(request, response) { debug.log('notification: ' + JSON.stringify(msg)); ++messages_in; - transmit(msg); - response.writeHead(200, {'Content-Type': 'text/plain'}); + try { + transmit(msg); + response.writeHead(200, {'Content-Type': 'text/plain'}); + } catch (err) { + debug.log( + '<%s> Internal Server Error! %s', + request.socket.remoteAddress, + err); + response.statusCode = 500; + response.write('500 Internal Server Error\n'); + } } catch (err) { debug.log( '<%s> Bad Request! %s',