Skip to content

Error handling #7

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

Closed
no-longer-on-githu-b opened this issue Jul 21, 2016 · 4 comments
Closed

Error handling #7

no-longer-on-githu-b opened this issue Jul 21, 2016 · 4 comments
Labels
type: enhancement A new feature or addition.

Comments

@no-longer-on-githu-b
Copy link

no-longer-on-githu-b commented Jul 21, 2016

It seems there is no way to attach error handlers to HTTP servers. Am I missing something?

E.g. the equivalent of the following JS:

var s = http.createServer(h);
s.on('error', function(err) { console.log('oops!', err); });
s.listen(9000); // in case of failure, will call the above callback
@hdgarrood
Copy link
Member

I don't think you're missing anything, I think it is just that nobody has needed that yet so there's no binding for it. I guess we want an onError :: Server -> (Error -> Eff _ Unit) -> Eff _ Unit in Node.HTTP?

@no-longer-on-githu-b
Copy link
Author

Yeah that should work. Shall I do a PR tonight?

@hdgarrood
Copy link
Member

Go for it. :)

nkly pushed a commit to purescript-express/purescript-express that referenced this issue Nov 20, 2017
Also update documentation.

Rewriting `listenHttp(s)` functions using `makeHttp(s)Server` is blocked
by purescript-node/purescript-node-http#7
@JordanMartinez JordanMartinez added the type: enhancement A new feature or addition. label Dec 7, 2021
@JordanMartinez
Copy link
Contributor

Fixed by #49.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A new feature or addition.
Projects
None yet
Development

No branches or pull requests

3 participants