catch write exceptions in tee