diff options
author | Paul A. Patience <paul@apatience.com> | 2022-01-26 06:41:27 -0500 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-01-27 11:53:25 -0800 |
commit | 9bc3c76dae6dd5f8fe328218f82bd0787c519fdf (patch) | |
tree | f3460c4e1ee101eabf80b8bbe85bf907dadeb1bc | |
parent | e598d80b54d15546be2f04cbb3a5be4255d93159 (diff) | |
download | txr-9bc3c76dae6dd5f8fe328218f82bd0787c519fdf.tar.gz txr-9bc3c76dae6dd5f8fe328218f82bd0787c519fdf.tar.bz2 txr-9bc3c76dae6dd5f8fe328218f82bd0787c519fdf.zip |
filter: actually throw from filter-string-tree.
* filter.c (filter_string_tree): The function tries to call
uw_throwf when an invalid filter is provided, but an overzealous
return statement renders the effort futile. Remove the return
statement, change the exception type from error_s to
type_error_s, and conform the message to the usual type-error
style.
-rw-r--r-- | filter.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -305,6 +305,8 @@ static val trie_filter_string(val filter, val str) val filter_string_tree(val filter, val obj) { + val self = lit("filter-string-tree"); + switch (type(obj)) { case NIL: return nil; @@ -320,8 +322,8 @@ val filter_string_tree(val filter, val obj) return trie_filter_string(filter, obj); else if (type == fun_s) return funcall1(filter, obj); - return obj; - uw_throwf(error_s, lit("invalid filter ~a"), filter, nao); + uw_throwf(type_error_s, lit("~a: ~s isn't a filter"), + self, filter, nao); } } } |