Handle errors raised in ruby blocks?


#1

I have some ruby blocks in a cookbook I’m working on. What is the proper way to raise/handle issues when something goes wrong in one of the blocks?

For example, in one block I’m using FileUtils.copy_file to copy a large zip archive from a server to the node running the recipe. When the file source doesn’t exist, the failure is silent and the recipe just keeps on trucking. I’m wrapping the command in a begin/rescue block and calling ‘Chef::Application.fatal!’, but no dice.

Can somebody provide the clue stick?

Thanks.

-Pete