As a person using "the app"
I want to see a friendly error message when I navigate to a "page" (route) that doesn't exisit.
So that I don't feel like I "broke" something or worse that the app is "broken"...!
Required
We need a way to create a "catch all" route that:
Timestamp the failed request occured
Logs the url the person was attempting to view
Logs any conn details e.g:
Device/Browser
Session ID (so we can help the person if they were looking for something!)
Any other useful data?
Once we have logged the request we should show a friendly error page.
We've done something similarbefore for Hapi.js: https://github.com/dwyl/hapi-error
But we can take it much further now because we can assume that most Phoenix web apps will
have a an Ecto Repo (i.e: a Database) where we can log the failed requests...
could this be a perfect candidate for logging to ElasticSearch so we don't "pollute" the main DB?
see: https://github.com/dwyl/learn-phoenix-framework/issues/64
Required
We need a way to create a "catch all" route that:
url
the person was attempting to viewconn
details e.g:Once we have logged the request we should show a friendly error page. We've done something similar
before
for Hapi.js: https://github.com/dwyl/hapi-error But we can take it much further now because we can assume that most Phoenix web apps will have a an Ecto Repo (i.e: a Database) where we can log the failed requests... could this be a perfect candidate for logging to ElasticSearch so we don't "pollute" the main DB? see: https://github.com/dwyl/learn-phoenix-framework/issues/64