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 using ne_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 a printf-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 Β© 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