StreamWriter wrapped in a try...catch statement