# HG changeset patch # User Emmanuel Gil Peyrot # Date 1282864149 -7200 # Node ID 0ed3c06c5191761e85c649345f64b1bc389d0aef # Parent 44889cfb2f8c9751fbed699a7449cc3b7e83d548 Add an uncaught exceptions caughter to prevent the server from crashing. diff --git a/psgxs.js b/psgxs.js --- 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) {