Jacob R

Jacob R

  • NA
  • 38
  • 0

C# Exception error question

Jun 16 2010 10:45 PM

I'm a bit confused about this.  Would a method with a try catch block, catch the error of another method that it calls?  I'll do some example code...
 

 private void methodA()
{
   try
   {
      ...do some code
      methodB();
   }
   catch (exception e)
   {
      messagebox.show(e.message);
   }
}
 
private void methodB()
{
   do some code that errors...
}

 
So will methodA display the exception.message that methodB encountered?  If not, can you explain how I would get it to?
 
Thanks
-Shifty

Answers (4)