Packages

Functions to parse URLs including scheme-specific URLs such as `tel`, `data`, `geo`, `uuid` and `mailto`. Modelled on the URI module.

Current section

Files

Jump to
ex_url lib parse_helpers unwrap.ex
Raw

lib/parse_helpers/unwrap.ex

defmodule URL.ParseHelpers.Unwrap do
@moduledoc false
@doc false
def unwrap({:ok, acc, "", _, _, _}) when is_list(acc) do
{:ok, acc}
end
@doc false
def unwrap({:error, reason, rest, _, {line, _}, _offset}) do
{:error, {URL.Parser.ParseError, "#{reason}. Detected on line #{inspect line} at #{inspect(rest, printable_limit: 20)}"}}
end
@doc false
def unwrap({:ok, acc, rest, _, _, _}) when is_list(acc) do
{:error, {URL.Parser.ParseError, "Error detected at #{inspect rest}"}}
end
end