ircanywhere / irc-factory

A rebuilt irc-factory from simple-irc-socket and irc-message. Get support at #ircanywhere on freenode
https://ircanywhere.com
MIT License
60 stars 14 forks source link

Use safe stringify when serializing error msg #16

Closed rodms10 closed 10 years ago

rodms10 commented 10 years ago

Using circular structure safe JSON serialization for error message. Doing this because I got this error at some point:

irc-factory/lib/api.js:20
        self.emit('uncaughtException', {message: JSON.stringify(err)});
                                                      ^
TypeError: Converting circular structure to JSON
    at Object.stringify (native)
    at process.<anonymous> (/Users/rodrigo/projs/irc-factory/lib/api.js:20:49)
    at process.EventEmitter.emit (events.js:117:20)
    at process._fatalException (node.js:272:26)