D
Darrel
I asked this a while ago but got sidetracked and now have finally gotten
back to it.
Karl wrote a nice (and easy to read) article here:
http://codebetter.com/blogs/karlseguin/archive/2006/04/05/142355.aspx
I've given it a once through, and, while it made sense, I know I'm still
missing a large amount of knowelege regarding global error handling.
Anyways, here's my specific scneario:
I have a function I'd like to call that returns a data set:
myFunction()
try
...to connect to DB and grab DS...
...return DS...
catch
...return an error...
end try
end myFunction
I normally do this as 99% of the time (at least when building an app) my
errors are caused by a DB issue. A bad query/bad table permissions/etc.
Typically, if I embed the function on my page, I just do a response.write.
Of course, that won't work if I'm calling the class from elsewhere.
So, based on that, if all I want is to know if the function properly
executed, how can I pass that back? It seems that I can either return a DS
or I can return an exception. Can I/Should I just do something like (pseudo
code):
if myFunction().typeOfReturnValue = ds then
' things worked
else
' things did not work.
end if
back to it.
Karl wrote a nice (and easy to read) article here:
http://codebetter.com/blogs/karlseguin/archive/2006/04/05/142355.aspx
I've given it a once through, and, while it made sense, I know I'm still
missing a large amount of knowelege regarding global error handling.
Anyways, here's my specific scneario:
I have a function I'd like to call that returns a data set:
myFunction()
try
...to connect to DB and grab DS...
...return DS...
catch
...return an error...
end try
end myFunction
I normally do this as 99% of the time (at least when building an app) my
errors are caused by a DB issue. A bad query/bad table permissions/etc.
Typically, if I embed the function on my page, I just do a response.write.
Of course, that won't work if I'm calling the class from elsewhere.
So, based on that, if all I want is to know if the function properly
executed, how can I pass that back? It seems that I can either return a DS
or I can return an exception. Can I/Should I just do something like (pseudo
code):
if myFunction().typeOfReturnValue = ds then
' things worked
else
' things did not work.
end if