Errors: Support a filter to control which errors are reported

Fixes #335
No conditional logic needed outside if the filter function is internal property of Error object.