diff --git a/lib/mint/http2/frame.ex b/lib/mint/http2/frame.ex index 8a6a9c43..98f2a96b 100644 --- a/lib/mint/http2/frame.ex +++ b/lib/mint/http2/frame.ex @@ -472,4 +472,7 @@ defmodule Mint.HTTP2.Frame do defp humanize_error_code(unquote(code)), do: unquote(human_code) defp dehumanize_error_code(unquote(human_code)), do: unquote(code) end + + defp humanize_error_code(code), do: {:custom_error, code} + defp dehumanize_error_code({:custom_error, code}), do: code end diff --git a/test/mint/http2/frame_test.exs b/test/mint/http2/frame_test.exs index ad85a9fb..e9714706 100644 --- a/test/mint/http2/frame_test.exs +++ b/test/mint/http2/frame_test.exs @@ -294,7 +294,10 @@ defmodule Mint.HTTP2.FrameTest do :connect_error, :enhance_your_calm, :inadequate_security, - :http_1_1_required + :http_1_1_required, + {:custom_error, 0x11}, + {:custom_error, 0xFF}, + {:custom_error, 70007} ]) end end