]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
now that the base errors are better, rely on them
authorAlan T. DeKok <aland@freeradius.org>
Thu, 18 Nov 2021 01:26:59 +0000 (20:26 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 18 Nov 2021 01:26:59 +0000 (20:26 -0500)
instead of doubling up on errors

src/lib/server/cond_tokenize.c
src/lib/util/value.c
src/tests/unit/condition/base.txt

index f6a1719c81d97d9b8a8fa45a6f2e5bbf19e64335..6eb506a220bcb55cbdc706bb77cca0d197e6d06e 100644 (file)
@@ -196,8 +196,6 @@ static int cond_cast_tmpl(tmpl_t *vpt, fr_type_t type, tmpl_t *other)
        fr_strerror_clear();
 
        if (tmpl_cast_in_place(vpt, type, da) < 0) {
-               fr_strerror_printf_push("Failed parsing value as type '%s'",
-                                       fr_table_str_by_value(fr_value_box_type_table, type, "??"));
                return -1;
        }
 
index 322986a81aec8d23d1df5392ed4ae8b6feee86a7..f74142d101b24200e0fbf70696f41122750c18bc 100644 (file)
@@ -4355,7 +4355,7 @@ fr_slen_t fr_value_box_from_numeric_substr(fr_value_box_t *dst, fr_type_t dst_ty
                }
 
                if (err == FR_SBUFF_PARSE_ERROR_NOT_FOUND) {
-                       fr_strerror_printf("Cannot parse type '%s' from input string",
+                       fr_strerror_printf("Failed parsing string as type '%s'",
                                           fr_table_str_by_value(fr_value_box_type_table, dst_type, "<INVALID>"));
                } else {
                        fr_sbuff_parse_error_to_strerror(err);
index cbcc3aa39bb86508e0789a3fd76333ec818e736e..067e9e4b55f6ac4e1c3f2466084c184063195f20 100644 (file)
@@ -219,10 +219,10 @@ condition &Event-Timestamp == 'January 1, 2012'
 
 # literals are parsed when the conditions are parsed
 condition <integer>X == 1
-match ERROR offset 9: token not found: Failed parsing value as type 'uint32'
+match ERROR offset 9: Failed parsing string as type 'uint32'
 
 condition &NAS-Port == X
-match ERROR offset 13: token not found: Failed parsing value as type 'uint32'
+match ERROR offset 13: Failed parsing string as type 'uint32'
 
 #
 #  The RHS is a static string, so this gets mashed to a literal,
@@ -250,7 +250,7 @@ condition <ether> 00:11:22:33:44:55 == "%{md4:00:11:22:33:44:55}"
 match 00:11:22:33:44:55 == "%{md4:00:11:22:33:44:55}"
 
 condition <ether> 00:XX:22:33:44:55 == 00:11:22:33:44:55
-match ERROR offset 8: Missing separator, expected ':': Failed parsing value as type 'ether'
+match ERROR offset 8: Missing separator, expected ':'
 
 #
 #  Tests for boolean data types.
@@ -331,7 +331,7 @@ condition <ipaddr>127.0.0.1/32 == 127.0.0.1
 match true
 
 condition <ipaddr>127.0.0.1/327 == 127.0.0.1
-match ERROR offset 8: Invalid IPv4 mask length "/327".  Should be between 0-32: Failed parsing value as type 'ipaddr'
+match ERROR offset 8: Invalid IPv4 mask length "/327".  Should be between 0-32
 
 condition <ipaddr>127.0.0.1/32 == 127.0.0.1
 match true