teamikl / ninjam-chat

NINJAM Chat gateway
http://teamikl.github.io/ninjam-chat
2 stars 1 forks source link

WebSocket サーバのエラー処理 #18

Closed teamikl closed 9 years ago

teamikl commented 9 years ago
teamikl commented 9 years ago
msg = try
  JSON.parse data
catch
  console.error e.message
  ""
teamikl commented 9 years ago
chunk = try
  JSON.stringify msg
catch
  console.error e.message
  null
teamikl commented 9 years ago
process.on \uncaughtException, (e) !->
  console.error "uncaughtException: #{e}"

http://nodejs.org/api/process.html#process_event_uncaughtexception

todo use domain? but read node 2014 why domains are bad wait until node 1.0 has stable API