Skip to content

Handle errors (e.g. couchdb server down) #9

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Handle errors (e.g. couchdb server down) #9

wants to merge 1 commit into from

Conversation

bkniffler
Copy link

Necessary to catch errors due to connection issue to couchdb instance. Errors can then be caught by something like

app.use((err, req, res, next) => {
  console.error(err.stack);
  res.status(500).send('Something broke!');
});

If you accept this PR, I'd be super-grateful about a new version publish :)

Thanks for the great work.

ps. It would've been even a greater experience if this repo had provided a couchdb config file, something (feel free to add it to readme!) like:

[chttpd]
bind_address = any
port = 5984
authentication_handlers = {couch_httpd_auth, proxy_authentication_handler}, {couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler}

[httpd]
bind_address = any

[couch_httpd_auth]
proxy_use_secret = true
secret = SOME_SECRET

Its easy to confuse the httpd and chttpd section of authentication_handlers.

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

Successfully merging this pull request may close these issues.

1 participant