getsentry/raven-node — pull request #87 by rcoup (2014-08-05 04:31:46+00:00)
Title: Capture stack traces when captureError() is called without an Error object

Currently, when `captureError()` is called without an Error object (eg. `raven.captureError("wtf?")`) it gets passed to `captureMessage()` is called, and any context is totally lost.

All you might (ahem) get in sentry is "Error: true" and no idea even which `client.captureError()` call was responsible.

The patch synthesizes an error via `new Error()` and then grabs a stack trace from that. Obviously the innermost frame will be `captureError()` itself, and you may have lost callback context, but it's got to be better than nothing at all :)