diff options
author | Loïc Hoguin <[email protected]> | 2019-01-05 17:50:30 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-01-05 17:50:30 +0100 |
commit | ab72796fdcc30a1227cbdd9069bd36aff14ebcfc (patch) | |
tree | 9eb721b1e9e050453207ff1f8f7f23d344cfbe77 | |
parent | bd91a3207f4376bd63a72f6c5b1ebabb11747634 (diff) | |
download | gun-ab72796fdcc30a1227cbdd9069bd36aff14ebcfc.tar.gz gun-ab72796fdcc30a1227cbdd9069bd36aff14ebcfc.tar.bz2 gun-ab72796fdcc30a1227cbdd9069bd36aff14ebcfc.zip |
Clarify option errors in the manual for gun:open/open_unix
Also fix an http into http2 for one option.
-rw-r--r-- | doc/src/manual/gun.open.asciidoc | 10 | ||||
-rw-r--r-- | doc/src/manual/gun.open_unix.asciidoc | 4 | ||||
-rw-r--r-- | src/gun_http2.erl | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/doc/src/manual/gun.open.asciidoc b/doc/src/manual/gun.open.asciidoc index 2e6c8b9..79a9d54 100644 --- a/doc/src/manual/gun.open.asciidoc +++ b/doc/src/manual/gun.open.asciidoc @@ -9,11 +9,13 @@ gun:open - Open a connection to the given host and port [source,erlang] ---- open(Host, Port) -> open(Host, Port, #{}) -open(Host, Port, Opts) -> {ok, pid()} | {error, any()} +open(Host, Port, Opts) -> {ok, pid()} | {error, Reason} -Host :: inet:hostname() | inet:ip_address() -Port :: inet:port_number() -Opts :: gun:opts() +Host :: inet:hostname() | inet:ip_address() +Port :: inet:port_number() +Opts :: gun:opts() +Reason :: {options, OptName} | {options, {http | http2, OptName}} | any() +OptName :: atom() ---- Open a connection to the given host and port. diff --git a/doc/src/manual/gun.open_unix.asciidoc b/doc/src/manual/gun.open_unix.asciidoc index 225ecc8..4ea8d2b 100644 --- a/doc/src/manual/gun.open_unix.asciidoc +++ b/doc/src/manual/gun.open_unix.asciidoc @@ -8,10 +8,12 @@ gun:open_unix - Open a connection to the given Unix domain socket [source,erlang] ---- -open_unix(SocketPath, Opts) -> {ok, pid()} | {error, any()} +open_unix(SocketPath, Opts) -> {ok, pid()} | {error, Reason} SocketPath :: string() Opts :: gun:opts() +Reason :: {options, OptName} | {options, {http | http2, OptName}} | any() +OptName :: atom() ---- Open a connection to the given Unix domain socket. diff --git a/src/gun_http2.erl b/src/gun_http2.erl index 1e59a7e..9159d78 100644 --- a/src/gun_http2.erl +++ b/src/gun_http2.erl @@ -63,7 +63,7 @@ do_check_options([]) -> do_check_options([Opt={content_handlers, Handlers}|Opts]) -> case gun_content_handler:check_option(Handlers) of ok -> do_check_options(Opts); - error -> {error, {options, {http, Opt}}} + error -> {error, {options, {http2, Opt}}} end; do_check_options([{keepalive, infinity}|Opts]) -> do_check_options(Opts); |