NE_GET_ERROR(3)
π NAME π
okay so this is NE_GET_ERROR(3), fresh from the neon API reference, and itβs all about ne_get_error and ne_set_error β aka error handling for HTTP sessions, bestie. π
β¨ SYNOPSIS β¨
#include <ne_session.h>
const char *ne_get_error(ne_sesssion *session);
void ne_set_error(ne_sesssion *session, const char *format, ...);
π DESCRIPTION π
So the session error string is where the HTTP session keeps any human-readable error information linked to any errors that happen whilst youβre using the session. Iconic little storage situation, honestly.
ne_get_errorβ 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 usingne_i18n_init(3), the returned string may have been translated into the userβs current locale. πβ¨ne_set_errorβ lets you set a new session error string, using aprintf-style format string interface. Very βI make my own error messageβ of it.
π RETURN VALUE π
The RETURN VALUE section says ne_set_error returns a constant NUL-terminated string. In the default English locale, the returned string will not have a terminating . period character. periodt, but no actual 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");
π COPYRIGHT π
Copyright Β© 2001-2026 Joe Orton
mwah π source/version: neon, date: 03/20/2026 β thatβs the cute little footer sign-off, folded in instead of copied line-for-line. bye bestie π«ΆπΈ
π¦ where this page comes from
- arch rolling: neon 0.37.1-1 Β· LGPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms