Date: 10/06/05 (C Sharp) Keywords: no keywords What do you do when your exception handler throws an exception? For example say you have the following code: try { //do something that's so impossibly cool, your head would explode if you saw it(hence, no code) } catch(Exception x) { Trace.Listeners.Add(new TextwriterTraceListener("log.txt", "LOG")); Trace.WriteLine("oh NOES tEh expection! " + x.Message); Trace.Listeners["LOG"].Close(); Trace.Listeners.Remove("LOG"); } So say you catch an exception, but then your TextWriterTraceListener's underyling StreamWriter can't access log.txt, so it throws an IOException. Does your program just have to acknowledge that it's SOL and crash and burn? Is it Bad Design(TM) to do things this way? Will our heroes make it to the...oh wait, I got carried away with the questions there. Source: http://www.livejournal.com/community/csharp/37248.html
|