elixir-mint / mint

Functional HTTP client for Elixir with support for HTTP/1 and HTTP/2 🌱
Apache License 2.0
1.36k stars 106 forks source link

no function clause matching in Mint.HTTP1.format_error/1 #295

Closed gjaldon closed 3 years ago

gjaldon commented 3 years ago

We were getting an error in production that looks like:

(CaseClauseError no case clause matching: {:error, "got FunctionClauseError with message \"no function clause matching in Mint.HTTP1.format_error/1\" while retrieving Exception.message/1 for %Mint.HTTPError{module: Mint.HTTP1, reason: %Mint.TransportError{reason: :einval}}"})

It turns out einval error is not being handled by Mint here https://github.com/elixir-mint/mint/blob/dd7c7b46f012fef177e761d3cea1e1cf6f5a9795/lib/mint/http1.ex#L964. I think einval may have come from gen_tcp. Would be great to handle this error and all possible errors in format_error/1.

whatyouhide commented 3 years ago

Good catch, fixed!

gjaldon commented 3 years ago

Thanks for the quick fix!