Catch all errors and return 0 written in Stream.