diff psgxs.js @ 11:0ed3c06c5191

Add an uncaught exceptions caughter to prevent the server from crashing.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 27 Aug 2010 01:09:09 +0200
parents 44889cfb2f8c
children 9a6b8b3357c6
line wrap: on
line diff
--- a/psgxs.js
+++ b/psgxs.js
@@ -46,6 +46,10 @@ function _(m, c) {
 	sys.puts('');
 };
 
+process.addListener('uncaughtException', function (err) {
+	console.log('\033[41;1mUncaught exception, this should never happen: ' + err + '.\033[0m');
+});
+
 if (typeof xmpp.StanzaBuilder.cnode != 'function' || typeof xmpp.StanzaBuilder.prototype.cnode != 'function') {
 	xmpp.StanzaBuilder.prototype.cnode = function (stanza)
 	{