Packages
ankh
0.16.0
0.17.0
0.16.0
0.15.0
0.14.5
0.14.4
0.14.3
0.14.2
0.14.1
0.14.0
0.13.0
0.12.1
0.12.0
0.11.0
0.10.0
0.9.0
0.8.11
0.8.10
0.8.9
0.8.8
0.8.7
0.8.6
0.8.5
0.8.4
0.8.3
0.8.2
0.8.1
0.8.0
0.7.2
0.7.1
0.7.0
0.6.0
0.5.3
0.5.2
0.5.1
0.5.0
0.4.6
0.4.5
0.4.4
0.4.3
0.4.2
0.4.1
0.4.0
0.3.1
0.3.0
0.1.1
0.1.0
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
Pure Elixir HTTP/2 implementation
Current section
Files
Jump to
Current section
Files
lib/ankh/http/error.ex
defmodule Ankh.HTTP.Error do
@moduledoc "HTTP Error"
errors = [
{:no_error, "Graceful shutdown"},
{:protocol_error, "Protocol error detected"},
{:internal_error, "Implementation fault"},
{:flow_control_error, "Flow-control limits exceeded"},
{:settings_timeout, "Settings not acknowledged"},
{:stream_closed, "Frame received for closed stream"},
{:frame_size_error, "Frame size incorrect"},
{:refused_stream, "Stream not processed"},
{:cancel, "Stream cancelled"},
{:compression_error, "Compression state not updated"},
{:connect_error, "TCP connection error for CONNECT method"},
{:enanche_your_calm, "Processing capacity exceeded"},
{:inadequate_security, "Negotiated TLS parameters not acceptable"},
{:http_1_1_required, "Use HTTP/1.1 for the request"}
]
@typedoc "HTTP/2 Error"
@type reason ::
unquote(
Enum.map_join(errors, " | ", &inspect(elem(&1, 0)))
|> Code.string_to_quoted!()
)
@doc """
Returns a human readable string for the corresponding error code atom
"""
@spec format(reason()) :: String.t()
for {reason, message} <- errors do
def format(unquote(reason)), do: unquote(message)
end
end