message: Use new exception handling with domain error handlers and requestHandler
diff: @@ -299,7 +299,7 @@ extend(Raven.prototype, {
  * We could consider getting rid of it and just duplicating the domain
  * instantiation etc logic in the requestHandler middleware
  */
  - context: function (ctx, func, onErr) {
  + context: function (ctx, func) {
  if (!func && typeof ctx === 'function') {
  func = ctx;
  ctx = {};
  @@ -308,10 +308,10 @@ extend(Raven.prototype, {
  // todo/note: raven-js takes an args param to do apply(this, args)
  // i don't think it's correct/necessary to bind this to the wrap call
  // and i don't know if we need to support the args param; it's undocumented
  - return this.wrap(ctx, func, onErr).apply(null);
  + return this.wrap(ctx, func).apply(null);
  },
  - wrap: function (options, func, onErr) {
  + wrap: function (options, func) {
  if (!func && typeof options === 'function') {
  func = options;
  options = {};
  @@ -321,17 +321,7 @@ extend(Raven.prototype, {
  // todo: better property name than sentryContext, maybe __raven__ or sth?
  wrapDomain.sentryContext = options;
  - var self = this;
  - if (typeof onErr !== 'function') {
  - onErr = function (err) {
  -
  - self.captureException(err, function (sendErr) {
  - self.onFatalError(err);
  - });
  - };
  - }
  -
  - wrapDomain.on('error', onErr);
  + wrapDomain.on('error', this.makeErrorHandler());
  var wrapped = wrapDomain.bind(func);
  for (var property in func) {
  @@ -443,7 +433,7 @@ extend(Raven.prototype, {
  domain.active.add(req);
  domain.active.add(res);
  next();
  - }, next);
  + });
  };
  },
  