@@ -20,6 +20,7 @@ static const char *LCURL_ERROR = LCURL_ERROR_NAME;
20
20
#define LCURL_ERROR_MULTI_NAME "CURL-MULTI"
21
21
#define LCURL_ERROR_SHARE_NAME "CURL-SHARE"
22
22
#define LCURL_ERROR_FORM_NAME "CURL-FORM"
23
+ #define LCURL_ERROR_URL_NAME "CURL-URL"
23
24
24
25
typedef struct lcurl_error_tag {
25
26
int tp ;
@@ -72,12 +73,24 @@ static const char* lcurl_err_form_mnemo(int err){
72
73
#undef ERR_ENTRY
73
74
}
74
75
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
+
75
87
static const char * _lcurl_err_mnemo (int tp , int err ){
76
88
switch (tp ){
77
89
case LCURL_ERROR_EASY : return lcurl_err_easy_mnemo (err );
78
90
case LCURL_ERROR_MULTI : return lcurl_err_multi_mnemo (err );
79
91
case LCURL_ERROR_SHARE : return lcurl_err_share_mnemo (err );
80
92
case LCURL_ERROR_FORM : return lcurl_err_form_mnemo (err );
93
+ case LCURL_ERROR_URL : return lcurl_err_url_mnemo (err );
81
94
}
82
95
assert (0 );
83
96
return "<UNSUPPORTED ERROR TYPE>" ;
@@ -89,6 +102,7 @@ static const char* _lcurl_err_msg(int tp, int err){
89
102
case LCURL_ERROR_MULTI : return curl_multi_strerror (err );
90
103
case LCURL_ERROR_SHARE : return curl_share_strerror (err );
91
104
case LCURL_ERROR_FORM : return lcurl_err_form_mnemo (err );
105
+ case LCURL_ERROR_URL : return lcurl_err_url_mnemo (err );
92
106
}
93
107
assert (0 );
94
108
return "<UNSUPPORTED ERROR TYPE>" ;
@@ -100,6 +114,7 @@ static const char* _lcurl_err_category_name(int tp){
100
114
(tp == LCURL_ERROR_MULTI ) ||
101
115
(tp == LCURL_ERROR_SHARE ) ||
102
116
(tp == LCURL_ERROR_FORM ) ||
117
+ (tp == LCURL_ERROR_URL ) ||
103
118
0
104
119
);
105
120
@@ -120,6 +135,10 @@ static const char* _lcurl_err_category_name(int tp){
120
135
static const char * name = LCURL_ERROR_FORM_NAME ;
121
136
return name ;
122
137
}
138
+ case LCURL_ERROR_URL : {
139
+ static const char * name = LCURL_ERROR_URL_NAME ;
140
+ return name ;
141
+ }
123
142
}
124
143
125
144
assert (0 );
@@ -147,6 +166,7 @@ int lcurl_error_create(lua_State *L, int error_type, int no){
147
166
(error_type == LCURL_ERROR_MULTI ) ||
148
167
(error_type == LCURL_ERROR_SHARE ) ||
149
168
(error_type == LCURL_ERROR_FORM ) ||
169
+ (error_type == LCURL_ERROR_URL ) ||
150
170
0
151
171
);
152
172
@@ -233,13 +253,15 @@ static const int ERROR_CATEGORIES[] = {
233
253
LCURL_ERROR_MULTI ,
234
254
LCURL_ERROR_SHARE ,
235
255
LCURL_ERROR_FORM ,
256
+ LCURL_ERROR_URL ,
236
257
};
237
258
238
259
static const char * ERROR_CATEGORIES_NAME [] = {
239
260
LCURL_ERROR_EASY_NAME ,
240
261
LCURL_ERROR_MULTI_NAME ,
241
262
LCURL_ERROR_SHARE_NAME ,
242
263
LCURL_ERROR_FORM_NAME ,
264
+ LCURL_ERROR_URL_NAME ,
243
265
NULL
244
266
};
245
267
@@ -297,6 +319,10 @@ static const lcurl_const_t lcurl_error_codes[] = {
297
319
298
320
#define ERR_ENTRY (N ) { "E_FORM_"#N, CURL_FORMADD_##N },
299
321
#include "lcerr_form.h"
322
+ #undef ERR_ENTRY
323
+
324
+ #define ERR_ENTRY (N ) { "E_URL_"#N, CURLUE_##N },
325
+ #include "lcerr_url.h"
300
326
#undef ERR_ENTRY
301
327
302
328
{NULL , 0 }
0 commit comments