Mercurial > psgxs
comparison 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 |
comparison
equal
deleted
inserted
replaced
10:44889cfb2f8c | 11:0ed3c06c5191 |
---|---|
43 sys.print(sys.inspect(m, false, null)); | 43 sys.print(sys.inspect(m, false, null)); |
44 if (c) | 44 if (c) |
45 sys.print('\033[0m'); | 45 sys.print('\033[0m'); |
46 sys.puts(''); | 46 sys.puts(''); |
47 }; | 47 }; |
48 | |
49 process.addListener('uncaughtException', function (err) { | |
50 console.log('\033[41;1mUncaught exception, this should never happen: ' + err + '.\033[0m'); | |
51 }); | |
48 | 52 |
49 if (typeof xmpp.StanzaBuilder.cnode != 'function' || typeof xmpp.StanzaBuilder.prototype.cnode != 'function') { | 53 if (typeof xmpp.StanzaBuilder.cnode != 'function' || typeof xmpp.StanzaBuilder.prototype.cnode != 'function') { |
50 xmpp.StanzaBuilder.prototype.cnode = function (stanza) | 54 xmpp.StanzaBuilder.prototype.cnode = function (stanza) |
51 { | 55 { |
52 var parent = this; | 56 var parent = this; |