Errors: Support a filter to control which errors are reported

Fixes #335
I'd really prefer path only here, lest we start accepting functions for everything that is path based.