Skip to content
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

Vigil.call/2 and rescue #4

Open
ericsullivan opened this issue May 22, 2023 · 1 comment
Open

Vigil.call/2 and rescue #4

ericsullivan opened this issue May 22, 2023 · 1 comment

Comments

@ericsullivan
Copy link

I just received a RuntimeError:

expected Vigil.call/2 to return a Plug.Conn, all plugs must receive a connection (conn) and return a connection, got: :ok

caused by the rescue returning :ok

def call(%Plug.Conn{} = conn, opts) do
    ...
  rescue
    e ->
      LogFormatter.log(conn, e, opts)
  end

Did you want to call reraise/2 or forbid_connection?

I didn't set the log_level in the plug so I'm not sure of the underlying exception.

@alex0112
Copy link
Contributor

Hi @ericsullivan ! I'm the original author of this plug. I'm no longer at Podium, but I just noticed this issue today. (Thanks for your patience, I only just noticed the issue today)

My thought here after glancing at the issue briefly is to have the rescue return the original conn, erring on the side of assuming that the error occurred within the plug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants