这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@davydog187
Copy link
Contributor

Compiling 11 files (.ex)
    warning: unknown key .message in expression:

        err.message

    where "err" was given the type:

        # type: %{..., __exception__: true, __struct__: atom()}
        # from: lib/mix/tasks/configure_phoenix.ex:21
        rescue err ->

    hint: when you rescue without specifying exception names, the variable is assigned a type of a struct but all of its fields are unknown. If you are trying to access an exception's :message key, either specify the exception names or use `Exception.message/1`.

    typing violation found at:

 21 │       err -> log_error(err.message)
    │                            ~~~~~~~

    └─ lib/mix/tasks/configure_phoenix.ex:21:28: Mix.Tasks.LiveSvelte.ConfigurePhoenix.run/1

```elixir
Compiling 11 files (.ex)
    warning: unknown key .message in expression:

        err.message

    where "err" was given the type:

        # type: %{..., __exception__: true, __struct__: atom()}
        # from: lib/mix/tasks/configure_phoenix.ex:21
        rescue err ->

    hint: when you rescue without specifying exception names, the variable is assigned a type of a struct but all of its fields are unknown. If you are trying to access an exception's :message key, either specify the exception names or use `Exception.message/1`.

    typing violation found at:
    │
 21 │       err -> log_error(err.message)
    │                            ~~~~~~~
    │
    └─ lib/mix/tasks/configure_phoenix.ex:21:28: Mix.Tasks.LiveSvelte.ConfigurePhoenix.run/1
```
@woutdp woutdp merged commit 00f0ae4 into woutdp:master Sep 19, 2024
@woutdp
Copy link
Owner

woutdp commented Sep 19, 2024

Very nice thank you!

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.

2 participants