J
Jim Heavey
I am trying to understand the uses for the the InnerException method of an
Exception object.
Looking at the documentation, I have summized this about using the
InnerException method....
If you have a method which can cause and exception, but you really do not
want to deal with the exception in that method, but you need/want to
provide some "details" of the circumstances of the error, is this when you
would catch the exception in that method, provide the details, and then
generate another exception passing along those details? Then the exception
woul go up the chain until some procedure caught the exception and then
would deal with it all the while have all the appropriate infomation to
deal with it?
Is this accurate?
What is not particular clear to me is how I would add value to this.
Suppose I wanted the "error message text" to be something like "Procedure
failed in .... The reason was.....". In order to do this I would have to
create an instance of my own error object and set the message accordingly?
System.Exception(e.InnerException.Message, e.InnerException)
Thanks In Advance for your assistance!!!!!!
Exception object.
Looking at the documentation, I have summized this about using the
InnerException method....
If you have a method which can cause and exception, but you really do not
want to deal with the exception in that method, but you need/want to
provide some "details" of the circumstances of the error, is this when you
would catch the exception in that method, provide the details, and then
generate another exception passing along those details? Then the exception
woul go up the chain until some procedure caught the exception and then
would deal with it all the while have all the appropriate infomation to
deal with it?
Is this accurate?
What is not particular clear to me is how I would add value to this.
Suppose I wanted the "error message text" to be something like "Procedure
failed in .... The reason was.....". In order to do this I would have to
create an instance of my own error object and set the message accordingly?
System.Exception(e.InnerException.Message, e.InnerException)
Thanks In Advance for your assistance!!!!!!