refactor(error): add error messages

This commit is contained in:
2025-10-26 18:18:18 +01:00
parent 80977bcb7e
commit c13c8c61ae
2 changed files with 23 additions and 12 deletions

View File

@@ -9,20 +9,21 @@ typedef enum cws_server_ret {
CWS_SERVER_EPOLL_CREATE_ERROR,
CWS_SERVER_CLIENT_DISCONNECTED_ERROR,
CWS_SERVER_HTTP_PARSE_ERROR,
CWS_SERVER_CONFIG,
CWS_SERVER_CONFIG_ERROR,
CWS_SERVER_GETADDRINFO_ERROR,
CWS_SERVER_SOCKET_ERROR,
CWS_SERVER_SETSOCKOPT_ERROR,
CWS_SERVER_BIND_ERROR,
CWS_SERVER_LISTEN_ERROR,
CWS_SERVER_WORKER_ERROR,
CWS_SERVER_UNKNOWN_ERROR,
} cws_server_ret;
typedef struct cws_error {
cws_server_ret code;
char *str;
char *msg;
} cws_error_s;
char *cws_error_str(cws_server_ret code);
const char *cws_error_str(cws_server_ret code);
#endif