-
Notifications
You must be signed in to change notification settings - Fork 82
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
Ignore binwrite error response handling warning #951
Conversation
Sounds like this would break in real apps, wouldn't we want to ship a new version with this? |
I'm not too confident with the change because of this, either. In older lang versions wouldn't be a huge break but a silent crash, probably. What do you think if we avoid Dialyzer checking that line? At the end of the day, it's only an unmatchable pattern warning. |
If it can never be anything else than an :ok = IO.binwrite(file, appsignal_config_file_contents(config))
IO.puts("Success!") If it raises an error, it would become something like: try do
:ok = IO.binwrite(file, appsignal_config_file_contents(config))
IO.puts("Success!")
rescue
e -> e
IO.puts("Failure! #{inspect(e)}")
exit(:shutdown)
end |
It might be an error tuple on older versions. That's why maybe it's more sensible to skip the linter. |
aa81d6f
to
932f7c6
Compare
IO's module `binwrite/2` function no longer returns an error touple when failing. Instead, it raises an Erlang error. This commit makes dialyzer ignore that warning so it behaves appropriately in newer and older versions. [skip changeset]
932f7c6
to
67d79f3
Compare
This is a message from the daily scheduled checks. |
IO's module
binwrite/2
function no longer returns an error touple whenfailing. Instead, it raises an Erlang error. This commit makes dialyzer
ignore that warning so it behaves appropriately in newer and older
versions.
[skip changeset]
Ref: https://github.com/elixir-lang/elixir/blob/v1.17.1/lib/elixir/lib/io.ex#L280-L284