Writing exceptions to local files