Handling Partial Failure in a Tree (Need Code Structure Ideas)

We currently build all of our packages in a list, if one fails the entire build fails.    We would like to move to a system where the failure is noted, but it continues on trying to build any packages that were not dependant on the one that failed.   Allowing us to see more than one build failure at a time.

Example:

Package1.bpl (Depends only on packages already compiled)
    Package2.bpl Depends on Package1.bpl
    Package3.bpl Depends on Package3.bpl
Package4.bpl (Depends only packages already compiled)
Package5.bpl (Depends only packages already compiled)
    Package6.bpl Depends on Package5.bpl
        Package7.bpl Depends on Package6.bpl
    Package8.bpl Depends on Package3.bpl


If I start the build and Package1.bpl Fails, I would like it to not try to build 2 or 3, but continue on and build 4,5,6,7, and 8.

Then when complete trying the entire tree, It would like to Fail the build. So I can send an email saying... Package 1 failed (and possibly others)

Although I have not used the Stack actions, I think they may work well for handling logging the errors and handling each when failing.

The tree functionality of not building 2 and 3 when 1 fails might be a not be realisitc, but I thought I would post here for some ideas just incase I have missed some build in functionality.

 

 

 

 


 

Hi Robert,

This is my suggestion:

try
     Package1.bpl (Depends only on packages already compiled) [Log to variable: FailureMsg]
          Package2.bpl Depends on Package1.bpl [Log to variable: FailureMsg]
          Package3.bpl Depends on Package3.bpl [Log to variable: FailureMsg]
catch
     Record error in variable or file or send email, eg. "Error occurred in Package1-3: %FailureMsg%"
end
try
     Package4.bpl (Depends only packages already compiled) [Log to variable: FailureMsg]
catch
     Record error in variable or file or send email, eg. "Error occurred in Package5: %FailureMsg%"
end
try
     Package5.bpl (Depends only packages already compiled) [Log to variable: FailureMsg]
          Package6.bpl Depends on Package5.bpl [Log to variable: FailureMsg]
               Package7.bpl Depends on Package6.bpl [Log to variable: FailureMsg]
          Package8.bpl Depends on Package3.bpl [Log to variable: FailureMsg]
catch
     Record error in variable or file or send email, eg. "Error occurred in Package5-8: %FailureMsg%"
end

The catches will handle the error condition, and allow the build to continue on.

Thank you I will try that.