summaryrefslogtreecommitdiff
path: root/doc/ref/err.xml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/ref/err.xml')
-rw-r--r--doc/ref/err.xml66
1 files changed, 66 insertions, 0 deletions
diff --git a/doc/ref/err.xml b/doc/ref/err.xml
new file mode 100644
index 0000000..50551b5
--- /dev/null
+++ b/doc/ref/err.xml
@@ -0,0 +1,66 @@
+ <refentry id="referr">
+
+ <refmeta>
+ <refentrytitle>ne_get_error</refentrytitle>
+ <manvolnum>3</manvolnum>
+ </refmeta>
+
+ <refnamediv>
+ <refname id="ne_get_error">ne_get_error</refname>
+ <refname id="ne_set_error">ne_set_error</refname>
+ <refpurpose>error handling for HTTP sessions</refpurpose>
+ </refnamediv>
+
+ <refsynopsisdiv>
+
+ <funcsynopsis>
+
+ <funcsynopsisinfo>#include &lt;ne_session.h&gt;</funcsynopsisinfo>
+
+ <funcprototype>
+ <funcdef>const char *<function>ne_get_error</function></funcdef>
+ <paramdef>ne_sesssion *<parameter>session</parameter></paramdef>
+ </funcprototype>
+
+ <funcprototype>
+ <funcdef>void <function>ne_set_error</function></funcdef>
+ <paramdef>ne_sesssion *<parameter>session</parameter></paramdef>
+ <paramdef>const char *<parameter>format</parameter></paramdef>
+ <paramdef>...</paramdef>
+ </funcprototype>
+
+ </funcsynopsis>
+
+ </refsynopsisdiv>
+
+ <refsect1>
+ <title>Description</title>
+
+ <para>The session error string is used to store any
+human-readable error information associated with any errors which
+occur whilst using the HTTP session.</para>
+
+ <para>The <function>ne_get_error</function> function returns the current
+session error string. This string persists only until it is changed by a
+subsequent operation on the session.</para>
+
+ <para>The <function>ne_set_error</function> function can be
+used to set a new session error string, using a
+<function>printf</function>-style format string interface.</para>
+
+ </refsect1>
+
+ <refsect1>
+ <title>Examples</title>
+ <para>Retrieve the current error string:</para>
+ <programlisting>&egsess;
+...
+printf("Error was: %s\n", ne_get_error(sess));</programlisting>
+
+ <para>Set a new error string:</para>
+ <programlisting>&egsess;
+...
+ne_set_error(sess, "Response missing header %s", "somestring");</programlisting>
+ </refsect1>
+
+ </refentry>