1NE_GET_ERROR(3) neon API reference NE_GET_ERROR(3)
2
3
4
6 ne_get_error, ne_set_error - error handling for HTTP sessions
7
9 #include <ne_session.h>
10
11 const char *ne_get_error(ne_sesssion *session);
12
13 void ne_set_error(ne_sesssion *session, const char *format, ...);
14
16 The session error string is used to store any human-readable error
17 information associated with any errors which occur whilst using the
18 HTTP session.
19
20 The ne_get_error function returns the current session error string.
21 This string persists only until it is changed by a subsequent operation
22 on the session. If localisation was enabled at build time, and if
23 necessary enabled at run-time if necessary using ne_i18n_init, the
24 returned string may have been translated into the user's current
25 locale.
26
27 The ne_set_error function can be used to set a new session error
28 string, using a printf-style format string interface.
29
31 ne_set_error returns a constant NUL-terminated string. In the default
32 English locale, the returned string will not have a terminating “.”
33 period character.
34
36 Retrieve the current error string:
37
38 ne_session *sess = ne_session_create(...);
39 ...
40 printf("Error was: %s\n", ne_get_error(sess));
41
42 Set a new error string:
43
44 ne_session *sess = ne_session_create(...);
45 ...
46 ne_set_error(sess, "Response missing header %s", "somestring");
47
49 Joe Orton <neon@lists.manyfish.co.uk>
50 Author.
51
53neon 0.32.2 12 January 2022 NE_GET_ERROR(3)