aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/manual/gun_error.asciidoc
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-06-02 22:44:16 +0200
committerLoïc Hoguin <[email protected]>2018-06-02 22:44:16 +0200
commit5b810c924da242632a04a2c44772cb892aa1b7c0 (patch)
treee9ee81bd3b6aea1f9665914b8858edad377c24c7 /doc/src/manual/gun_error.asciidoc
parent04b41c3cf70aba88c1dd76e4e86c39458d817219 (diff)
downloadgun-5b810c924da242632a04a2c44772cb892aa1b7c0.tar.gz
gun-5b810c924da242632a04a2c44772cb892aa1b7c0.tar.bz2
gun-5b810c924da242632a04a2c44772cb892aa1b7c0.zip
Revamp the manual, one page per function/message
Diffstat (limited to 'doc/src/manual/gun_error.asciidoc')
-rw-r--r--doc/src/manual/gun_error.asciidoc67
1 files changed, 67 insertions, 0 deletions
diff --git a/doc/src/manual/gun_error.asciidoc b/doc/src/manual/gun_error.asciidoc
new file mode 100644
index 0000000..a43d32b
--- /dev/null
+++ b/doc/src/manual/gun_error.asciidoc
@@ -0,0 +1,67 @@
+= gun_error(3)
+
+== Name
+
+gun_error - Stream or connection-wide error
+
+== Description
+
+[source,erlang]
+----
+{gun_error, ConnPid, StreamRef, Reason}
+{gun_error, ConnPid, Reason}
+
+ConnPid :: pid()
+StreamRef :: reference()
+Reason :: any()
+----
+
+Stream or connection-wide error.
+
+These messages inform the relevant process that an error
+occurred. A reference is given when the error pertains
+to a specific stream. Connection-wide errors do not
+imply that the connection is no longer usable, they are
+used for all errors that are not specific to a stream.
+
+== Elements
+
+ConnPid::
+
+The pid of the Gun connection process.
+
+StreamRef::
+
+Identifier of the stream that resulted in an error.
+
+Reason::
+
+The reason for the error.
++
+It is present for debugging purposes only. You should not
+rely on this value to perform operations programmatically.
+
+== Changelog
+
+* *1.0*: Message introduced.
+
+== Examples
+
+.Receive a gun_error message in a gen_server
+[source,erlang]
+----
+handle_info({gun_error, ConnPid, _Reason},
+ State=#state{conn_pid=ConnPid}) ->
+ %% Do something.
+ {noreply, State};
+handle_info({gun_error, ConnPid, _StreamRef, _Reason},
+ State=#state{conn_pid=ConnPid}) ->
+ %% Do something.
+ {noreply, State}.
+----
+
+== See also
+
+link:man:gun(3)[gun(3)],
+link:man:gun_up(3)[gun_up(3)],
+link:man:gun_down(3)[gun_down(3)]