-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Ecto.NoResultsError not swallowed #5767
Comments
We need more information. Is this in dev with debug_errors set to true (which does not wrap errors)? Can you share your controller which does the Repo.get!? Thanks! |
config :waitlist, WaitlistWeb.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 4000],
check_origin: false,
code_reloader: false,
debug_errors: false, Simplified controller code defmodule WaitlistWeb.AdminController do
use WaitlistWeb, :controller
import Ecto.Query
alias Waitlist.Repo
alias Waitlist.Models.User
def show(conn, %{"id" => id}) do
user = Repo.get!(User, id)
render(conn, :user, user: user)
end
end Double checked with this one and still have error logged with a GenServer crash. |
@chrismccord any news? Maybe it will be helpful if i can provide a working demo for all this? |
I just tried upgrading to Bandit and I'm noticing that exceptions implementing the Here's a sample app that recreates the issue even with
Ideally I'd expect to see just the |
I've got a nice clean solution for this coming in the next Bandit; working on it today and should have it out this weekend. |
Bandit PR up for review that takes Plug.Exception.status/1 into consideration when handling exceptions & adds a log_exceptions_with_status_codes config option (defaulting to 500..599). This should shut Bandit up for non 500 errors by default @aaronrenner @m1ome any chance you can test with |
Thanks @mtrudel! I just tested this in the sample app and at work and I can confirm it fixes the issue! I really appreciate your help! ❤️ |
Bandit fix just went out as 1.5.0 |
Thanks @mtrudel. Awesome job! |
I will close this one, it's fixed in bandit 1.5.0, thanks to @mtrudel |
Environment
Actual behavior
Expect code in controller:
Produce a 404 error code and not log any exception.
Expected behavior
Logs and answers with 404 error and crashes GenServer
The text was updated successfully, but these errors were encountered: