Filter errors
Write output