Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Latest version breaks #10

Closed
Tivoli opened this issue Mar 19, 2013 · 2 comments
Closed

Latest version breaks #10

Tivoli opened this issue Mar 19, 2013 · 2 comments

Comments

@Tivoli
Copy link

Tivoli commented Mar 19, 2013

I can start my app fine without bugsnag, but as soon as I try bugsnag.register I get the following error.

TypeError: Cannot read property 'handle' of undefined
    at Function.app.use (/Users/tivs/Documents/github/foxy-web/node_modules/express/lib/application.js:111:9)
    at Function.app.configure.app.use.express.static.maxAge (/Users/tivs/Documents/github/foxy-web/server.coffee:72:16)
    at Function.app.configure (/Users/tivs/Documents/github/foxy-web/node_modules/express/lib/application.js:396:61)
    at Object.<anonymous> (/Users/tivs/Documents/github/foxy-web/server.coffee:63:7)
    at Object.<anonymous> (/Users/tivs/Documents/github/foxy-web/server.coffee:103:4)
    at Module._compile (module.js:456:26)
    at Object.exports.run (/usr/local/share/npm/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:124:25)
    at compileScript (/usr/local/share/npm/lib/node_modules/coffee-script/lib/coffee-script/command.js:166:29)
    at /usr/local/share/npm/lib/node_modules/coffee-script/lib/coffee-script/command.js:141:18
    at fs.js:252:14
    at Object.oncomplete (fs.js:93:15)
@snmaynard
Copy link
Contributor

It looks like you've upgraded from 0.x to 1.0.

We've cleaned up the interface and so there are some client changes that need to be made. The error you are seeing looks like you are passing bugsnag.register into app.use. We had to change this interface as we now have two middlewares (one for getting information about a request, and the other to report errors).

To ensure that asynchronous errors are routed to the error handler, add the requestHandler middleware to your app as the first middleware:

app.use(bugsnag.requestHandler);

You'll also need to add Bugsnag's error handling middleware, make sure to add this after all other middleware, but before any "error" middleware:

app.use(bugsnag.errorHandler);

@Tivoli
Copy link
Author

Tivoli commented Mar 19, 2013

Gotcha, thanks ^^

@Tivoli Tivoli closed this as completed Mar 19, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants