osmlab / to-fix-backend

The to-fix server
BSD 3-Clause "New" or "Revised" License
15 stars 13 forks source link

Mocking db and testing status error #121

Closed kepta closed 7 years ago

kepta commented 7 years ago

This PR adds test coverage when db.authenticate fails.

cc @mcwhittemore @batpad

batpad commented 7 years ago

This looks good to me @kepta, ty!

@mcwhittemore will be great to have a quick show n tell or so with you at some point on how exactly the error handling / passing of errors is handled in the app, using mapbox-errors, etc.

I can't figure out, how to silent the error when we want to throw the error

@kepta this is the console.logs that are still logging the errors? I think this is desired behaviour for the server for 500 errors - since we want to serve the user a simple error page, but log a full stack trace of errors so that we can find them later and debug. We should spend a bit of time understanding the error handling middleware a bit better - this PR looks good to merge to me though.