raven
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -0,1 +1,4 @@ | ||
# 1.1.1 and 1.0.1 - 12/13/2016 | ||
- Fix middleware backwards compatibility [See #246] | ||
# 1.1.0 - 12/12/2016 | ||
@@ -2,0 +5,0 @@ - Added support for (automatic) breadcrumbs [See #240] |
'use strict'; | ||
var Raven = require('../client'); | ||
var utils = require('../utils'); | ||
@@ -10,7 +11,12 @@ // Legacy support | ||
var getClient = function (clientOrDSN) { | ||
// Raven is an instance, so use Raven.constructor for instanceof check | ||
return clientOrDSN instanceof Raven.constructor ? clientOrDSN : new Raven.Client(clientOrDSN); | ||
}; | ||
// Error handler. This should be the last item listed in middleware, but | ||
// before any other error handlers. | ||
connectMiddleware.errorHandler = function (client) { | ||
client = client instanceof Raven.Client ? client : new Raven.Client(client); | ||
return client.errorHandler(); | ||
connectMiddleware.errorHandler = function (clientOrDSN) { | ||
utils.consoleAlert('top-level Raven.middleware.*.errorHandler has been deprecated and will be removed in v2.0; use Raven.errorHandler() instance method instead'); | ||
return getClient(clientOrDSN).errorHandler(); | ||
}; | ||
@@ -20,7 +26,10 @@ | ||
// should be the **first** item listed in middleware. | ||
connectMiddleware.requestHandler = function (client) { | ||
client = client instanceof Raven.Client ? client : new Raven.Client(client); | ||
return client.requestHandler(); | ||
connectMiddleware.requestHandler = function (clientOrDSN) { | ||
utils.consoleAlert('top-level Raven.middleware.*.requestHandler has been deprecated and will be removed in v2.0; use Raven.requestHandler() instance method instead'); | ||
return getClient(clientOrDSN).requestHandler(); | ||
}; | ||
// for testing purposes only; not gonna worry about a nicer test exposure scheme since this code is going away soon | ||
connectMiddleware.getClient = getClient; | ||
module.exports = connectMiddleware; |
@@ -12,3 +12,3 @@ { | ||
], | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"repository": "git://github.com/getsentry/raven-node.git", | ||
@@ -15,0 +15,0 @@ "author": "Matt Robenolt <matt@ydekproductions.com>", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
352047
1498