@@ -20,6 +20,7 @@ static const char *LCURL_ERROR = LCURL_ERROR_NAME;
2020#define LCURL_ERROR_MULTI_NAME "CURL-MULTI"
2121#define LCURL_ERROR_SHARE_NAME "CURL-SHARE"
2222#define LCURL_ERROR_FORM_NAME "CURL-FORM"
23+ #define LCURL_ERROR_URL_NAME "CURL-URL"
2324
2425typedef struct lcurl_error_tag {
2526 int tp ;
@@ -72,12 +73,24 @@ static const char* lcurl_err_form_mnemo(int err){
7273#undef ERR_ENTRY
7374}
7475
76+ static const char * lcurl_err_url_mnemo (int err ){
77+ #define ERR_ENTRY (E ) case CURLUE_##E: return #E;
78+
79+ switch (err ){
80+ #include "lcerr_url.h"
81+ }
82+ return "UNKNOWN" ;
83+
84+ #undef ERR_ENTRY
85+ }
86+
7587static const char * _lcurl_err_mnemo (int tp , int err ){
7688 switch (tp ){
7789 case LCURL_ERROR_EASY : return lcurl_err_easy_mnemo (err );
7890 case LCURL_ERROR_MULTI : return lcurl_err_multi_mnemo (err );
7991 case LCURL_ERROR_SHARE : return lcurl_err_share_mnemo (err );
8092 case LCURL_ERROR_FORM : return lcurl_err_form_mnemo (err );
93+ case LCURL_ERROR_URL : return lcurl_err_url_mnemo (err );
8194 }
8295 assert (0 );
8396 return "<UNSUPPORTED ERROR TYPE>" ;
@@ -89,6 +102,7 @@ static const char* _lcurl_err_msg(int tp, int err){
89102 case LCURL_ERROR_MULTI : return curl_multi_strerror (err );
90103 case LCURL_ERROR_SHARE : return curl_share_strerror (err );
91104 case LCURL_ERROR_FORM : return lcurl_err_form_mnemo (err );
105+ case LCURL_ERROR_URL : return lcurl_err_url_mnemo (err );
92106 }
93107 assert (0 );
94108 return "<UNSUPPORTED ERROR TYPE>" ;
@@ -100,6 +114,7 @@ static const char* _lcurl_err_category_name(int tp){
100114 (tp == LCURL_ERROR_MULTI ) ||
101115 (tp == LCURL_ERROR_SHARE ) ||
102116 (tp == LCURL_ERROR_FORM ) ||
117+ (tp == LCURL_ERROR_URL ) ||
103118 0
104119 );
105120
@@ -120,6 +135,10 @@ static const char* _lcurl_err_category_name(int tp){
120135 static const char * name = LCURL_ERROR_FORM_NAME ;
121136 return name ;
122137 }
138+ case LCURL_ERROR_URL : {
139+ static const char * name = LCURL_ERROR_URL_NAME ;
140+ return name ;
141+ }
123142 }
124143
125144 assert (0 );
@@ -147,6 +166,7 @@ int lcurl_error_create(lua_State *L, int error_type, int no){
147166 (error_type == LCURL_ERROR_MULTI ) ||
148167 (error_type == LCURL_ERROR_SHARE ) ||
149168 (error_type == LCURL_ERROR_FORM ) ||
169+ (error_type == LCURL_ERROR_URL ) ||
150170 0
151171 );
152172
@@ -233,13 +253,15 @@ static const int ERROR_CATEGORIES[] = {
233253 LCURL_ERROR_MULTI ,
234254 LCURL_ERROR_SHARE ,
235255 LCURL_ERROR_FORM ,
256+ LCURL_ERROR_URL ,
236257};
237258
238259static const char * ERROR_CATEGORIES_NAME [] = {
239260 LCURL_ERROR_EASY_NAME ,
240261 LCURL_ERROR_MULTI_NAME ,
241262 LCURL_ERROR_SHARE_NAME ,
242263 LCURL_ERROR_FORM_NAME ,
264+ LCURL_ERROR_URL_NAME ,
243265 NULL
244266};
245267
@@ -297,6 +319,10 @@ static const lcurl_const_t lcurl_error_codes[] = {
297319
298320#define ERR_ENTRY (N ) { "E_FORM_"#N, CURL_FORMADD_##N },
299321#include "lcerr_form.h"
322+ #undef ERR_ENTRY
323+
324+ #define ERR_ENTRY (N ) { "E_URL_"#N, CURLUE_##N },
325+ #include "lcerr_url.h"
300326#undef ERR_ENTRY
301327
302328 {NULL , 0 }
0 commit comments