I'll bring in a concrete example, taken from a current problem I'm having with Passport. During or after authenticating, it seems that there is an event being triggered, which ends up with this error:
error: invalid input syntax for integer: "test@email.com"
at p.parseE (.../node_modules/pg/lib/connection.js:412:11)
at p.parseMessage (.../node_modules/pg/lib/connection.js:287:17)
at Socket.p.connect (.../node_modules/pg/lib/connection.js:45:22)
at Socket.EventEmitter.emit (events.js:88:17)
at TCP.onread (net.js:395:14)
Now, in this case, this has to do with the email login being passed (to PostgreSQL in this case) along instead of the user id, but I have no real way to find out where this event is being triggered, what code is initializing the event, and which code is triggering it.
Is there a better way than grep emitter?