Open callumlocke opened 7 years ago
I don't know any official way.
I agree that it would be much better to have at least some kind of Error with stack.
What you can do right now is to wrap content of your filter into try...catch
block, and in catch
throw error with provided information about source. Unfortunately, you have to figure out your own way to define that information about source.
For example, we're using Gray Matter to collect meta information about pages, and we inject it as part of context, so we can access at least information about which exactly template thrown error like that.
If you make a custom filter, and it throws an error because of some bad input, the resulting error does not give you the location of the bad filter call within your template.
Is there some special way to get this info?