Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow uncaught errors to bubble #6

Closed
ericuldall opened this issue Jul 16, 2015 · 7 comments
Closed

allow uncaught errors to bubble #6

ericuldall opened this issue Jul 16, 2015 · 7 comments
Assignees
Labels

Comments

@ericuldall
Copy link

Is there a way to allow unhandled errors to bubble up?

@dougwilson
Copy link
Contributor

Hi! I'm not really sure what the question is? All this module does is print out the error you handed to it. It sounds like you simply wouldn't even call this module for errors. Can you demonstrate an example of what you mean or even a PR :)?

@ericuldall
Copy link
Author

Yes. I wouldn't. unfortunately express uses this module. So i'm just looking into viable options for a fork.

@dougwilson
Copy link
Contributor

Gotcha. I mean, perhaps you would want to file an issue with Express. Can you also perhaps explain specifically what "allow unhandled errors to bubble up" means?

@ericuldall
Copy link
Author

Perhaps you're right. This may be express catching thrown errors and passing them into finalhandler. I'm still digging through the code. This module was just to point of output so I started here.

@ericuldall
Copy link
Author

Sorry. Bubble up means, don't catch my error for me.

@dougwilson
Copy link
Contributor

Express only defaults to this module if you don't provide your app with a final callback. If you provide a callback, you can do anything you want:

var express = require('express')
var http = require('http')

var app = express()

// declare things on app

var server = http.createServer(function (req, res) {
  app(req, res, function (err) {
    // this is your replacement for finalhandler
  })
})

server.listen(3000)

@dougwilson dougwilson self-assigned this Jul 16, 2015
@ericuldall
Copy link
Author

thank you :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants