Skip to content

Commit

Permalink
Fix dialyzer error for "bad record mac" handling
Browse files Browse the repository at this point in the history
The error was:

    lib/myxql/connection.ex:344:call
    The function call will not succeed.

    :ssl.format_error({:error, {:tls_alert, [32 | 97 | 98 | 99 | 100 | 101 | 109 | 111 | 114, ...]}})

    will never return since it differs in arguments with
    positions 1st from the success typing arguments:

    (
      atom()
      | maybe_improper_list()
      | {:error,
         atom()
         | maybe_improper_list()
         | {:error,
            atom()
            | maybe_improper_list()
            | {:error, atom() | maybe_improper_list() | {_, _}}
            | {:options, _}
            | {:tls_alert, {_, _}}}
         | {:options, _}
         | {:tls_alert, {_, _}}}
      | {:options, _}
      | {:tls_alert, {_, _}}
    )
  • Loading branch information
wojtekmach committed Jul 4, 2019
1 parent e883c79 commit d27dff8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/myxql/connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ defmodule MyXQL.Connection do
defp format_reason(:timeout), do: "timeout"
defp format_reason(:closed), do: "socket closed"

defp format_reason({:tls_alert, 'bad record mac'} = reason) do
defp format_reason({:tls_alert, {:bad_record_mac, _}} = reason) do
versions = :ssl.versions()[:supported]

"""
Expand Down

0 comments on commit d27dff8

Please sign in to comment.