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 | d18bf6605613cc0eb8038d1e42f5faac37510a1a (patch) | |
tree | f3460c4e1ee101eabf80b8bbe85bf907dadeb1bc /filter.c | |
parent | b67e288a9bd75fa8275e20827c689aa1444f2226 (diff) | |
download | txr-d18bf6605613cc0eb8038d1e42f5faac37510a1a.tar.gz txr-d18bf6605613cc0eb8038d1e42f5faac37510a1a.tar.bz2 txr-d18bf6605613cc0eb8038d1e42f5faac37510a1a.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.
Diffstat (limited to 'filter.c')
-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); } } } |