Skip to content
This repository has been archived by the owner on Sep 3, 2020. It is now read-only.

Database connection issues not handled gracefully #394

Open
errietta opened this issue Sep 17, 2015 · 0 comments
Open

Database connection issues not handled gracefully #394

errietta opened this issue Sep 17, 2015 · 0 comments
Assignees

Comments

@errietta
Copy link

If the database configuration is incorrect, and the connection fails, the user will get a 500 error and the terminal will bring an unfriendly error message:

{"name":"error","length":97,"severity":"FATAL","code":"28P01","file":"auth.c","line":"285","routine":"auth_failed","isBoom":true,"isServer":true,"data":null,"output":{"statusCode":500,"payload":{"statusCode":500,"error":"Internal Server Error","message":"An internal server error occurred"},"headers":{"Content-Security-Policy":"connect-src 'self';default-src 'none';font-src 'self' https://fonts.gstatic.com;img-src 'self' data: https://www.google-analytics.com http://www.google-analytics.com;script-src 'self' 'unsafe-eval' https://www.google-analytics.com http://www.google-analytics.com;style-src 'self' https://fonts.googleapis.com","content-type":"application/json; charset=utf-8","strict-transport-security":"max-age=15768000","x-frame-options":"DENY","x-xss-protection":"1; mode=block","x-download-options":"noopen","x-content-type-options":"nosniff","cache-control":"no-cache","content-encoding":"gzip","vary":"accept-encoding"}}},"msg":"","time":"2015-09-17T15:28:50.366Z","v":0}
{"name":"id-webmaker-org","hostname":"zekrom.errietta.me","pid":410,"level":20,"req_id":"1442503731119:zekrom.errietta.me:410:ieodgrvq:10003","data":{"id":"1442503731119:zekrom.errietta.me:410:ieodgrvq:10003","method":"get","url":"/favicon.ico","agent":"Mozilla/5.0 (X11; CrOS x86_64 7262.52.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.86 Safari/537.36"},"msg":"","time":"2015-09-17T15:28:51.120Z","v":0}
{"name":"id-webmaker-org","hostname":"zekrom.errietta.me","pid":410,"level":20,"req_id":"1442503731119:zekrom.errietta.me:410:ieodgrvq:10003","data":{"msec":1.9582271575927734},"msg":"","time":"2015-09-17T15:28:51.125Z","v":0}

A more friendly error should be shown:

return callback(err);
can be wrapped to catch it.

@errietta errietta changed the title Database issues not handled gracefully Database connection issues not handled gracefully Sep 17, 2015
@ashleygwilliams ashleygwilliams self-assigned this Sep 17, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants