473,490 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

do try/catches cascade?

Not sure if that's the proper term.

Let's say I have this:

function function1()
try
do something
function2()
catch
error
end try
end function
function function2()
try
do something
catch
error
end try
end function

When function 1 is called, will it abort if function 2 also aborts? Or will
function 1 do whatever it can regardless of whether function 2 aborts or
not?

-Darrel

Nov 19 '05 #1
4 872
"darrel" <no*****@hotmail.com> wrote in message
news:eN**************@TK2MSFTNGP15.phx.gbl...
When function 1 is called, will it abort if function 2 also aborts? Or
will
function 1 do whatever it can regardless of whether function 2 aborts or
not?


What did you observe when you tried it for yourself...?
Nov 19 '05 #2
> What did you observe when you tried it for yourself...?

I'm not there yet...still building...will report back... ;o)

-Darrel
Nov 19 '05 #3
Good question darrel.

Exceptions "bubble up," which means that when an exception occurs, and is
not handled, it is passed to the calling function. So, if the calling
function doesn't handle it, it throws the same exception, which is then
passed to the function that called IT. And so on. So, whether the exception
bubbles up is determined by whether or not the exception is caught and
handled gracefully in the function in which it is thrown.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Everybody picks their nose,
But some people are better at hiding it.

"darrel" <no*****@hotmail.com> wrote in message
news:eN**************@TK2MSFTNGP15.phx.gbl...
Not sure if that's the proper term.

Let's say I have this:

function function1()
try
do something
function2()
catch
error
end try
end function
function function2()
try
do something
catch
error
end try
end function

When function 1 is called, will it abort if function 2 also aborts? Or
will
function 1 do whatever it can regardless of whether function 2 aborts or
not?

-Darrel

Nov 19 '05 #4
> Exceptions "bubble up," which means that when an exception occurs, and is
not handled, it is passed to the calling function. So, if the calling
function doesn't handle it, it throws the same exception, which is then
passed to the function that called IT. And so on. So, whether the exception bubbles up is determined by whether or not the exception is caught and
handled gracefully in the function in which it is thrown.


Thanks, Kevin. That explains it nicely.

-Darrel
Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
5882
by: Fraser Hanson | last post by:
Hello, I have a table which has a foreign key relationship with itself. I want and expect my updates to cascade (deletes definitely cascade as expected) but instead I just get error 1217:...
1
8853
by: Andrew DeFaria | last post by:
I created the following .sql file to demonstrate a problem I'm having. According to the manual: If |ON DELETE CASCADE| is specified, and a row in the parent table is deleted, then InnoDB...
2
39410
by: Gunnar Vøyenli | last post by:
Hi! For the sake of simplicity, I have three tables, Employee, Department and Work Employee >---- Department \ / \ / ^ ^ Work
2
11498
by: P.B. via SQLMonster.com | last post by:
I cannot execute my sql to create a table with ON DELETE CASCADE option. Here is my sql: CREATE TABLE Employees (Name Text(10) not null, Age number, CONSTRAINT pkEmployees PRIMARY KEY (Name)); ...
2
6977
by: Jack | last post by:
We are have a question about the no cascade option on before triggers. The description stays that no other triggers will be fired by the changes of a before trigger. One of our developers is...
33
4237
by: Lee C. | last post by:
I'm finding this to be extremely difficult to set up. I understand that Access won't manage the primary key and the cascade updates for a table. Fine. I tried changing the PK type to number and...
14
5760
by: Karl O. Pinc | last post by:
Hi, Thought perhaps some other eyes than mine can tell if I'm doing something wrong here or if there's a bug somewhere. I've never passed a ROWTYPE varaible to a function but I don't see where...
2
3077
by: R.Welz | last post by:
Hello. I want to discuss a problem I have with my database design becourse I feel I cannot decide wheather I am on the right way of doing things. First of all, I am writing a literature and...
4
1247
by: roman | last post by:
Hi, I have a form which validates data before submitting, it catches the error, but still submits and can't seem to figure out why. Can someone look at my code and give me some ideas how to...
4
6381
by: Blue Apricot | last post by:
How can I prevent certain Class properties from cascading from a parent table to its children? Specifically, I have a table that acts as a container (I call it class="page"), with a certain...
0
7108
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6967
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7142
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6847
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7352
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4565
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1383
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
618
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.