By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,943 Members | 1,890 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,943 IT Pros & Developers. It's quick & easy.

Exception handling question

P: n/a
Dear all,

How can I handle correctly cascading exception?

I generally use to catch exception ib all my function.
This to identify each type the correct place that the
exception occurs. What could happen is that if an
exception occurs inside a function that call others
function, it happend that I could get a never ending loop
of exception routine calling other exception routines.

In case I have a function name Func1 that call inside
Func2,func3,func4,....

How to coreectly exit from function 1 incase an exception
occurs in Funct2, 3 or 4....? In other words how up
cascading can be handle.

fun3 shows its own exception, and funct1 catch exception
of function3.

thanks for your prompt answer
regards
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Serge,

If I understand your question, you're asking how do you get exceptions to
propagate.

The runtime has built-in support to handle moving exceptions from a called
function to a calling function. It will keep doing this until a function
either catches the exception or it hits the top function of the program. My
advice is only to catch exceptions if you have a specific recovery in mind,
such as asking the user for a new filename if they enter a bad one.

Hope that helps.

--
Eric Gunnerson

Visit the C# product team at http://www.csharp.net
Eric's blog is at http://blogs.gotdotnet.com/ericgu/

This posting is provided "AS IS" with no warranties, and confers no rights.
"serge calderara" <se*************@maillefer.net> wrote in message
news:04****************************@phx.gbl...
Dear all,

How can I handle correctly cascading exception?

I generally use to catch exception ib all my function.
This to identify each type the correct place that the
exception occurs. What could happen is that if an
exception occurs inside a function that call others
function, it happend that I could get a never ending loop
of exception routine calling other exception routines.

In case I have a function name Func1 that call inside
Func2,func3,func4,....

How to coreectly exit from function 1 incase an exception
occurs in Funct2, 3 or 4....? In other words how up
cascading can be handle.

fun3 shows its own exception, and funct1 catch exception
of function3.

thanks for your prompt answer
regards

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.