J
Julie
What should happen if you catch an exception and from that exception
handling code call a method which itself generates an exception that
gets caught? Is this sort of thing acceptable? Will the second
exception get caught? It seems like it should but I'm not absolutely
sure.
I have some code that crashed because of an exception not getting
caught, and I am trying to determine how this could have happened,
since I have "try/catch Exception" around all of my threads.
My "catch Exception" statements log the exception to a file; however,
I noticed that this logging code was not thread safe. So, it seems
quite possible that in handling an exception, a second exception would
be generated when the thread was attempting to simultaneously access
the log file at the same time as another thread.
Thoughts?
handling code call a method which itself generates an exception that
gets caught? Is this sort of thing acceptable? Will the second
exception get caught? It seems like it should but I'm not absolutely
sure.
I have some code that crashed because of an exception not getting
caught, and I am trying to determine how this could have happened,
since I have "try/catch Exception" around all of my threads.
My "catch Exception" statements log the exception to a file; however,
I noticed that this logging code was not thread safe. So, it seems
quite possible that in handling an exception, a second exception would
be generated when the thread was attempting to simultaneously access
the log file at the same time as another thread.
Thoughts?