More forgiving errors during dev with missing filters #3386
Labels
enhancement
needs-votes
A feature request on the backlog that needs upvotes or downvotes. Remove this label when resolved.
I’ve been using filters extensively. Most of my 11ty projects have an import like:
and a mass-add statement in the config:
If a filter is invalid, 11ty currently throws (and the error message code path is broken, see #3385).
I’d argue that this is not a reason for complete and total failure — a warning should suffice. Something like "Filter
foo
ignored, as it is not a function".However, then if filter
foo
is used anywhere, that would throw. But should it really?As part of debugging, I often comment out plugins. But that means now their filters produce errors! So temporarily disabling a plugin involves tediously adding stubs like
What if 11ty could do this for any unrecognized filter, and just printed out a warning? Fault tolerance and robustness are generally good API design principles to follow. The main case where you don't want to fail gracefully is when making the wrong assumption could produce data loss (see #3373), but that doesn’t seem to be the case here.
The text was updated successfully, but these errors were encountered: