1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-01-22 23:16:53 +00:00

Trap filter syntax errors

Now a syntax error on a filter just causes the filter to return the
error message as it’s single result.

Fixes #189
This commit is contained in:
Jermolene 2013-11-21 08:52:41 +00:00
parent a29c0dfce9
commit a45f64e738

View File

@ -131,7 +131,14 @@ exports.filterTiddlers = function(filterString,currTiddlerTitle,tiddlerList) {
};
exports.compileFilter = function(filterString) {
var filterParseTree = this.parseFilter(filterString);
var filterParseTree;
try {
filterParseTree = this.parseFilter(filterString);
} catch(e) {
return function(source,currTiddlerTitle) {
return ["Filter error: " + e];
};
}
// Get the hashmap of filter operator functions
var filterOperators = this.getFilterOperators();
// Assemble array of functions, one for each operation