@@ -139,7 +139,7 @@ static apr_array_header_t* _mapcache_dimension_regex_get_entries_for_value(mapca
139139 }
140140#endif
141141 else {
142- ctx -> set_error (ctx ,400 ,"failed to validate requested value for dimension (%s)" ,dim -> name );
142+ ctx -> set_error (ctx ,400 ,"failed to validate requested value for %s (%s)" , dim -> class_name ,dim -> name );
143143 }
144144 return values ;
145145}
@@ -165,7 +165,7 @@ static void _mapcache_dimension_regex_parse_xml(mapcache_context *ctx, mapcache_
165165 if (child_node && child_node -> txt && * child_node -> txt ) {
166166 dimension -> regex_string = apr_pstrdup (ctx -> pool ,child_node -> txt );
167167 } else {
168- ctx -> set_error (ctx ,400 ,"failed to parse dimension regex: no <regex> child supplied" );
168+ ctx -> set_error (ctx ,400 ,"failed to parse %s regex: no <regex> child supplied" , dim -> class_name );
169169 return ;
170170 }
171171#ifdef USE_PCRE
@@ -174,8 +174,8 @@ static void _mapcache_dimension_regex_parse_xml(mapcache_context *ctx, mapcache_
174174 int pcre_offset ;
175175 dimension -> pcregex = pcre_compile (dimension -> regex_string ,0 ,& pcre_err , & pcre_offset ,0 );
176176 if (!dimension -> pcregex ) {
177- ctx -> set_error (ctx ,400 ,"failed to compile regular expression \"%s\" for dimension \"%s\": %s" ,
178- dimension -> regex_string ,dim -> name ,pcre_err );
177+ ctx -> set_error (ctx ,400 ,"failed to compile regular expression \"%s\" for %s \"%s\": %s" ,
178+ dimension -> regex_string ,dim -> class_name , dim -> name ,pcre_err );
179179 return ;
180180 }
181181 }
@@ -185,8 +185,8 @@ static void _mapcache_dimension_regex_parse_xml(mapcache_context *ctx, mapcache_
185185 if (rc ) {
186186 char errmsg [200 ];
187187 regerror (rc ,dimension -> regex ,errmsg ,200 );
188- ctx -> set_error (ctx ,400 ,"failed to compile regular expression \"%s\" for dimension \"%s\": %s" ,
189- dimension -> regex_string ,dim -> name ,errmsg );
188+ ctx -> set_error (ctx ,400 ,"failed to compile regular expression \"%s\" for %s \"%s\": %s" ,
189+ dimension -> regex_string ,dim -> class_name , dim -> name ,errmsg );
190190 return ;
191191 }
192192 }
@@ -215,7 +215,7 @@ static apr_array_header_t* _mapcache_dimension_values_get_entries_for_value(mapc
215215 }
216216 }
217217 if (i == dimension -> values -> nelts ) {
218- ctx -> set_error (ctx ,400 ,"failed to validate requested value for dimension (%s)" ,dim -> name );
218+ ctx -> set_error (ctx ,400 ,"failed to validate requested value for %s (%s)" , dim -> class_name ,dim -> name );
219219 }
220220 return values ;
221221}
@@ -241,13 +241,13 @@ static void _mapcache_dimension_values_parse_xml(mapcache_context *ctx, mapcache
241241 dimension = (mapcache_dimension_values * )dim ;
242242
243243 if (!child_node ) {
244- ctx -> set_error (ctx ,400 ,"failed to parse dimension values: no <value> children supplied" );
244+ ctx -> set_error (ctx ,400 ,"failed to parse %s values: no <value> children supplied" , dim -> class_name );
245245 return ;
246246 }
247247 for (; child_node ; child_node = child_node -> next ) {
248248 const char * entry = child_node -> txt ;
249249 if (!entry || !* entry ) {
250- ctx -> set_error (ctx ,400 ,"failed to parse dimension values: empty <value>" );
250+ ctx -> set_error (ctx ,400 ,"failed to parse %s values: empty <value>" , dim -> class_name );
251251 return ;
252252 }
253253 APR_ARRAY_PUSH (dimension -> values ,char * ) = apr_pstrdup (ctx -> pool ,entry );
@@ -280,6 +280,7 @@ mapcache_dimension* mapcache_dimension_values_create(mapcache_context *ctx, apr_
280280{
281281 mapcache_dimension_values * dimension = apr_pcalloc (pool , sizeof (mapcache_dimension_values ));
282282 dimension -> dimension .type = MAPCACHE_DIMENSION_VALUES ;
283+ dimension -> dimension .class_name = "dimension" ;
283284 dimension -> values = apr_array_make (pool ,1 ,sizeof (char * ));
284285 dimension -> dimension ._get_entries_for_value = _mapcache_dimension_values_get_entries_for_value ;
285286 dimension -> dimension .configuration_parse_xml = _mapcache_dimension_values_parse_xml ;
@@ -292,6 +293,7 @@ mapcache_dimension* mapcache_dimension_regex_create(mapcache_context *ctx, apr_p
292293{
293294 mapcache_dimension_regex * dimension = apr_pcalloc (pool , sizeof (mapcache_dimension_regex ));
294295 dimension -> dimension .type = MAPCACHE_DIMENSION_REGEX ;
296+ dimension -> dimension .class_name = "dimension" ;
295297#ifndef USE_PCRE
296298 dimension -> regex = (regex_t * )apr_pcalloc (pool , sizeof (regex_t ));
297299#endif
0 commit comments