PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB` ne_get_error

Name

ne_get_error, ne_set_error — error handling for HTTP sessions

Synopsis

#include <ne_session.h>
const char *ne_get_error(ne_sesssion *session);
 
void ne_set_error(ne_sesssion *session,
 const char *format,
 ...);
 

Description

The session error string is used to store any human-readable error information associated with any errors which occur whilst using the HTTP session.

The ne_get_error 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's current locale.

The ne_set_error function can be used to set a new session error string, using a printf-style format string interface.

Return value

ne_set_error returns a constant NUL-terminated string. In the default English locale, the returned string will not have a terminating . period character.

Examples

Retrieve the current error string:

ne_session *sess = ne_session_create(...);
...
printf("Error was: %s\n", ne_get_error(sess));

Set a new error string:

ne_session *sess = ne_session_create(...);
...
ne_set_error(sess, "Response missing header %s", "somestring");