# Failed action not failing the build

**URL:** https://www.finalbuilder.com/forums/t/failed-action-not-failing-the-build/361
**Category:** Discussion
**Created:** [February 16, 2007, 10:29am UTC](https://www.finalbuilder.com/forums/t/failed-action-not-failing-the-build/361 "2007-02-16T10:29:52Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jhunsaker](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/j/b3f665/32.png) [@jhunsaker](https://www.finalbuilder.com/forums/u/jhunsaker)
#### Post date: [February 16, 2007, 10:29am UTC](https://www.finalbuilder.com/forums/t/failed-action-not-failing-the-build/361/1 "2007-02-16T10:29:52Z")

</div>

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.

 ![failed.JPG](https://www.finalbuilder.com/forums/uploads/default/original/1X/4470e4483c781af1f162d12d47c3365e1da04d6f.jpeg)

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [February 16, 2007, 11:33am UTC](https://www.finalbuilder.com/forums/t/failed-action-not-failing-the-build/361/2 "2007-02-16T11:33:43Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jhunsaker](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/j/b3f665/32.png) [@jhunsaker](https://www.finalbuilder.com/forums/u/jhunsaker)
#### Post date: [February 19, 2007, 2:06am UTC](https://www.finalbuilder.com/forums/t/failed-action-not-failing-the-build/361/3 "2007-02-19T02:06:09Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [February 19, 2007, 5:07am UTC](https://www.finalbuilder.com/forums/t/failed-action-not-failing-the-build/361/4 "2007-02-19T05:07:42Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jhunsaker](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/j/b3f665/32.png) [@jhunsaker](https://www.finalbuilder.com/forums/u/jhunsaker)
#### Post date: [March 6, 2007, 5:39am UTC](https://www.finalbuilder.com/forums/t/failed-action-not-failing-the-build/361/5 "2007-03-06T05:39:54Z")

</div>

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.
