write exceptions to file