|
So will methodA display the exception.message that methodB encountered? If not, can you explain how I would get it to?
Thanks
-Shifty
|
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Jun 20, 2010, 5:57 AM
Mahesh ChandPosted Jun 19, 2010, 11:46 AM
However, if you have some resources that are being created in MethodB, you must release them. Here is an example in pseudocode:
MethodB()
{
Create a File object
Open file
Do something with file and an exception raises.
}
You need to implement try..catch..finally block and in finally, you need to release the resources. In the above case, a File object is created and opened but not released. To release it, in Finally block, you need to release the file object.
This is not crucial for general .NET objects but it a must for IO, database connections and other system resources.
Roy SPosted Jun 19, 2010, 11:10 AM
Jacob RPosted Jun 17, 2010, 1:03 AM
Is there any downfalls to doing it this way or is it a correct way to go about it? Reason I ask is because I would hate to have to change my project code which is around 23k lines.