Re: HOWTO: Re-raise an error?
- From: "Michael Harris \(MVP\)" <mikhar at mvps dot org>
- Date: Thu, 31 Aug 2006 20:06:01 -0700
Ian Boyd wrote:
You cannot do
Err.raise
or
Err.raise Err.Number, Err.Source, Err.Description, Err.Helpfile,
Err.HelpContext
or
Dim Number
Dim Source
Dim Description
Dim Helpfile
Dim HelpContext
Number = Err.Number
Source = Err.Source
Description = Err.Description
Helpfile = Err.Helpfile
HelpContext = Err.HelpContext
Before you re-raise the error, make sure 'On Error Resume Next' is no longer
in effect...
On Error GoTo 0
Err.Raise Number, Source, Description, Helpfile, HelpContext
....otherwise you will simply throw the error back at yourself.
You can't even to
If Err.Number <> 0 Then
Dim Desc
Desc = Err.Description
Err.Raise 666, "Source is me", "Error doing thing: "&Desc
End If
How do you throw an exception?
--
Michael Harris
Microsoft MVP Scripting
.
- Follow-Ups:
- Re: HOWTO: Re-raise an error?
- From: Ian Boyd
- Re: HOWTO: Re-raise an error?
- References:
- HOWTO: Re-raise an error?
- From: Ian Boyd
- HOWTO: Re-raise an error?
- Prev by Date: Re: Creating a failure log
- Next by Date: Re: Logon HTA display not updating
- Previous by thread: Re: HOWTO: Re-raise an error?
- Next by thread: Re: HOWTO: Re-raise an error?
- Index(es):