Newbie: Showing that function might throw exception

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any way of clearly showing to the programmer that an exception might
be thrown from a function? In C++ you can write:

void MyClass::MyFunction(...) throw (MyException);

Is there anything similar in C#?

Thanks in advance
 
Joachim said:
Is there any way of clearly showing to the programmer that an exception might
be thrown from a function? In C++ you can write:

void MyClass::MyFunction(...) throw (MyException);

Is there anything similar in C#?

Thanks in advance

void MyFunctrion(...)
{
try
{
// do something
}
catch
{
// take corrective action
}
{
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top