Click to See Complete Forum and Search --> : Err.Raise - whats up with this?


Muthu Ram
October 4th, 1999, 01:40 PM
How do i propogate the error back to the calling function, and let that function handle it? I am using err.raise but for some reason its not handled in the calling function. It always results in runtime error. BTW, i have an error handler in the calling function.


'function called
public Function Add(objfav as clsFavorites, optional key as Variant) as clsFavorites
'some details omitted for clarity
on error GoTo raiseError
'set the properties passed into the method
mCol.Add objfav, key
'return the object
set Add = objfav
Exit Function
raiseError:
Err.Raise Err.Number
End Function

Chris Eastwood
October 4th, 1999, 02:14 PM
You do have an 'On Error Goto ....' in the calling function don't you ?

You'll have to post the code for the calling function as well, so we can see what's giving you problems.



Chris Eastwood

CodeGuru - the website for developers
http://codeguru.developer.com/vb

czimmerman
October 4th, 1999, 06:10 PM
Is this happening in the IDE or in the executable.
If it's in the IDE, make sure you don't have break on all errors checked in Tool | Options | General.

Charles Zimmerman
http://www.freevbcode.com
mailto:czimmerman@freevbcode.com

Jeremy_D
October 5th, 1999, 07:04 AM
If your (called) function does not have an Error handler (no 'On Error ...' line) the error will allways be propagated to the calling function.