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

Call Exception.message instead of accessing message field #5811

Conversation

lukaszsamson
Copy link
Contributor

fixes typechecker error

     warning: unknown key .message in expression:

         e.message

     where "e" was given the type:

         # type: %{..., __exception__: true, __struct__: atom()}
         # from: lib/phoenix/endpoint/cowboy2_adapter.ex:149
         rescue e ->

     hint: when you rescue without specifying exception names, the variable is assigned a type of a struct but all of its fields are unknown

     typing violation found at:
     │
 149 │     e -> {:error, e.message}
     │                     ~
     │
     └─ lib/phoenix/endpoint/cowboy2_adapter.ex:149:21: Phoenix.Endpoint.Cowboy2Adapter.server_info/2

@michallepicki
Copy link
Contributor

See 34d0ffe

@josevalim
Copy link
Member

Sorry, I didn't see your PR :(

@josevalim josevalim closed this May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants