Ability to whitelist exceptions
thousandsofthem opened this issue · comments
Would be really useful,
e.g.
Ecto.NoResultsError
is totally legit exception that should not be tracked anyhow
I think there is no legit execptions. Every exception will terminate process. I think when you code throws exceptions at runtime is really bad. It means that something happened that you don't expect, and you should take care of it, not hide.
With this feature you'll miss things that should never happened.
I think there is no legit execptions.
My real usecase:
Phoenix, getting 404 on some random request (various bots love to do that)
e.g. GET /randomcrap
-> Phoenix.Router.NoRouteError
What's the right solution?
usecase # 2: getting record by ID.
e.g.
def show(conn, %{"photo_id" => photo_id}) do
photo = Repo.get!(Photo, photo_id)
...
Code is clear and self-describing. if photo is not found - fail, show error. but i do not want to see similar errors in the error tracker (in many cases endusers can try random ids etc)
What's the right solution?
I agree, I would like be able to ignore certain errors, esp 404s from bots
I'm still not get it. Why you want to ignore exception instead of catch it and handle them ?
In case of 404 you can make your own beautiful not found page.
If you want to get data from data base, and expect that you won't find any items, user Repo.get
instead of Repo.get!
and process both cases.
Of course we can't implement that, but application should work without throwing exceptions, because this is exceptions and should not accurs. Will loog at this RP once again later.
Because with a 404 page it still send the error since Elixir.Phoenix.Router.NoRouteError
is raised
What about catch_errors: true
?
No that does not work either
Merged!