PDA

View Full Version : vbld_StepDone fails,build does not continue


teognost
11-12-2007, 09:02 AM
I have a step where "Continue building" checkbox is ticked.
So if the step fails -the build continues.For this step in ScriptEditor I have implemented some code for vbld_StepDone event.
Problem is -if this code fails-the build process is stopped despite of the "Continue building" set to TRUE.
As I see in the comments of vbld_StepDone -this is normal:
' If the step is marked to ignore failure, throwing or raising an error
' or calling Builder.Stop from this event will not ignore the failure
' (providing a way to abort the build even when the step is marked to
' ignore failure).
Question -is there any way to avoid this?
I mean even if the code in vbld_StepDone fails for some reason-the build process to contine.

kinook
11-12-2007, 10:16 AM
Eat the errors (On Error Resume Next in VBScript, try { ... } catch(err) { } in JScript).

teognost
12-14-2007, 01:05 PM
I added
On Error Resume Next
immediately after
Sub vbld_StepDone()
so the build continues but i do not see any error message.
I would need a way to see the error message and to trigger the failure step but to have the build continued with next step.

kinook
12-14-2007, 01:17 PM
See attached sample (assumes VBScript is default scripting language).

teognost
12-14-2007, 01:26 PM
Tks!
so the code :
' check failure and mark step as failed if so
If Err.Number <> 0 Then
Builder.LogMessage Err.Description
Step.BuildStatus = vbldStepStatFailed
End If
could stay only once at the end of the subprocedure,it is not necessary to write it after any operation that could fail.

kinook
12-14-2007, 01:28 PM
Yes, as long as Err is not cleared.