Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-12-2007, 09:02 AM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
vbld_StepDone fails,build does not continue

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.
Reply With Quote
  #2  
Old 11-12-2007, 10:16 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Eat the errors (On Error Resume Next in VBScript, try { ... } catch(err) { } in JScript).
Reply With Quote
  #3  
Old 12-14-2007, 01:05 PM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
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.
Reply With Quote
  #4  
Old 12-14-2007, 01:17 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
See attached sample (assumes VBScript is default scripting language).
Attached Files
File Type: bld scripterror.bld (928 Bytes, 1619 views)
Reply With Quote
  #5  
Old 12-14-2007, 01:26 PM
teognost teognost is online now
Registered User
 
Join Date: 05-25-2004
Location: Prague,Czech Republic
Posts: 200
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.
Reply With Quote
  #6  
Old 12-14-2007, 01:28 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Yes, as long as Err is not cleared.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 08:03 AM.


Copyright © 1999-2023 Kinook Software, Inc.