Not capturing details/context in Express when sending error via `captureException`

Hi there and thanks for your work on Sentry…it’s really great and has led me to find long-standing errors in the past immediately!

I’m running a Node(6.6)/Express(4.13.4) stack with the latest Raven SDK(1.2.0).

My problem is this: During the lifetime of requests there are some things that I may do that might throw errors that I either .catch() or try{}catch(err){} so that life can go on. Some of these are things that I want to move on gracefully from, but not exactly “ignore” completely or forget. That’s why I don’t let them bubble up to the error handler and am instead trying to shoot them off to Sentry so I can see them there and go track down the cause.

To do this, I’m using Raven.captureException(myError, ...). This does send the error to Sentry, but it comes in with far, far less information about what was going on than an unhandled error. Things like user id, url, cookies, IP, and a deeper stack trace are not there. Example:

// Important things happening up here
  .catch(err => {
    // not a show stopper, but I'd like to see rich info in Sentry to figure out WTF happened, who, etc.
    Raven.captureException(err, ...);

// still send response


// Or even just:
Raven.captureException(new Error('foo'), ...);

Is there something I can/should be doing that I’m not here? Thanks for any help!

I’ve set up Raven on as middleware in the prescribed fashion:

// The request handler must be the first middleware on the app
// The error handler must be before any other error middleware