summaryrefslogtreecommitdiffstats
path: root/filter.c
diff options
context:
space:
mode:
authorPaul A. Patience <paul@apatience.com>2022-01-26 06:41:27 -0500
committerKaz Kylheku <kaz@kylheku.com>2022-01-27 11:53:25 -0800
commitd18bf6605613cc0eb8038d1e42f5faac37510a1a (patch)
treef3460c4e1ee101eabf80b8bbe85bf907dadeb1bc /filter.c
parentb67e288a9bd75fa8275e20827c689aa1444f2226 (diff)
downloadtxr-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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/filter.c b/filter.c
index e2619140..7d273ef8 100644
--- a/filter.c
+++ b/filter.c
@@ -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);
}
}
}