123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- '\" t
- .\" Title: ne_get_error
- .\" Author:
- .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
- .\" Date: 12 January 2022
- .\" Manual: neon API reference
- .\" Source: neon 0.32.2
- .\" Language: English
- .\"
- .TH "NE_GET_ERROR" "3" "12 January 2022" "neon 0.32.2" "neon API reference"
- .\" -----------------------------------------------------------------
- .\" * Define some portability stuff
- .\" -----------------------------------------------------------------
- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- .\" http://bugs.debian.org/507673
- .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- .ie \n(.g .ds Aq \(aq
- .el .ds Aq '
- .\" -----------------------------------------------------------------
- .\" * set default formatting
- .\" -----------------------------------------------------------------
- .\" disable hyphenation
- .nh
- .\" disable justification (adjust text to left margin only)
- .ad l
- .\" -----------------------------------------------------------------
- .\" * MAIN CONTENT STARTS HERE *
- .\" -----------------------------------------------------------------
- .SH "NAME"
- ne_get_error, ne_set_error \- error handling for HTTP sessions
- .SH "SYNOPSIS"
- .sp
- .ft B
- .nf
- #include <ne_session\&.h>
- .fi
- .ft
- .HP \w'const\ char\ *ne_get_error('u
- .BI "const char *ne_get_error(ne_sesssion\ *" "session" ");"
- .HP \w'void\ ne_set_error('u
- .BI "void ne_set_error(ne_sesssion\ *" "session" ", const\ char\ *" "format" ", \&.\&.\&.);"
- .SH "DESCRIPTION"
- .PP
- The session error string is used to store any human\-readable error information associated with any errors which occur whilst using the HTTP session\&.
- .PP
- The
- \fBne_get_error\fR
- function returns the current session error string\&. This string persists only until it is changed by a subsequent operation on the session\&. If localisation was enabled at build time, and if necessary enabled at run\-time if necessary using
- ne_i18n_init, the returned string may have been translated into the user\*(Aqs current locale\&.
- .PP
- The
- \fBne_set_error\fR
- function can be used to set a new session error string, using a
- \fBprintf\fR\-style format string interface\&.
- .SH "RETURN VALUE"
- .PP
- \fBne_set_error\fR
- returns a constant
- NUL\-terminated string\&. In the default English locale, the returned string will
- \fInot\fR
- have a terminating
- \(lq\&.\(rq
- period character\&.
- .SH "EXAMPLES"
- .PP
- Retrieve the current error string:
- .sp
- .if n \{\
- .RS 4
- .\}
- .nf
- ne_session *sess = ne_session_create(\&.\&.\&.);
- \&.\&.\&.
- printf("Error was: %s\en", ne_get_error(sess));
- .fi
- .if n \{\
- .RE
- .\}
- .PP
- Set a new error string:
- .sp
- .if n \{\
- .RS 4
- .\}
- .nf
- ne_session *sess = ne_session_create(\&.\&.\&.);
- \&.\&.\&.
- ne_set_error(sess, "Response missing header %s", "somestring");
- .fi
- .if n \{\
- .RE
- .\}
- .SH "AUTHOR"
- .PP
- \fBJoe Orton\fR <\&[email protected]\&>
- .RS 4
- Author.
- .RE
- .SH "COPYRIGHT"
- .br
|