Errors: Support a filter to control which errors are reported

Fixes #335
Combine the two conditionals into one.