-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy patherrors.h
More file actions
38 lines (33 loc) · 1.56 KB
/
Copy patherrors.h
File metadata and controls
38 lines (33 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef ERROR_H_
#define ERROR_H_
#include <assert.h>
#include "common.h"
/* Expand this list if necessary. */
#define NL_ERRNO_MAP(XX) \
XX( 200, EYIELD, "attempt to yield across a C-call boundary") \
XX( 201, EYIELDFNZ, "yielding up finalize error") \
XX( 202, ESTACKLESS, "attempt to yield across a stack-less coroutine") \
XX( 203, ETCPSCLOSED, "tcp socket has been closed") \
XX( 204, ETCPLCLOSED, "tcp listen socket has been closed") \
XX( 205, ETCPNOWSHARED, "tcp socket not set write shared") \
XX( 206, ETCPWRITELONG, "attempt to send data too long") \
XX( 207, ETCPREADOVERFLOW,"read overflowed wake up") \
XX( 208, EUDPSCLOSED, "udp socket has been closed") \
XX( 209, EUDPNOWSHARED, "udp socket not set write shared") \
XX( 210, ENOCONTEXT, "context not exist or has been killed") \
XX( 211, ETRANSTYPE, "transfer data type not supported") \
XX( 212, ENOREPLY, "no reply") \
XX( 213, ETIMEOUT, "timeout") \
#define NL_ERRNO_GEN(val, name, s) NL_##name = val,
typedef enum {
NL_ERRNO_MAP(NL_ERRNO_GEN)
NL_MAX_ERRORS
} nl_err_code;
#undef NL_ERRNO_GEN
///////////////////////////////////////////////////////////////////////////////////////
extern const char* nl_err_name(nl_err_code err_code);
extern const char* nl_strerror(nl_err_code err_code);
///////////////////////////////////////////////////////////////////////////////////////
extern const char* common_err_name(int32_t err_code);
extern const char* common_strerror(int32_t err_code);
#endif