I have a "Check if File Exists" action set to "Fail Action If…File or Folder is Missing". The action fails but the FB build results still depicts "Build Successful". The action is within a Try…Catch block. Is there a way to re-throw the exception or set the FB results to failed?
Thanks.
Yes - use the Raise Exception action (if you want normal exception handling to work and the build will run the OnFailure etc), or use the Stop Run if you want it to stop immediately.
hth.
.t8
Ok, I’m dense. Could you walk me through this please? I can’t discover a way to cause the build to fail when encountering a “Check if file exists” failure within a Try…Catch.
Thanks for the patience!
Jeff… np
TRY
- Check If file exists
CATCH
- Stop Run
END
but… you might have to put a special TRY - CATCH - END block around the If file exists action to separate this error from another error inside another TRY - CATCH - END block. eg.
TRY
- Do stuff
- TRY
- - Check If file exists
- CATCH
- - Stop Run
- END
- Do more stuff
CATCH
- clean up…
END
hth!
.t8
I ended up re-raising an exception as the final step in my Catch block. This forces FB to fail the build (display the giant red ‘X’, etc.).
Thanks.