I'm working to deploy SQLProj (Database Project) via VS2013 and I'm encountering an issue that I could use some feedback on.
When I publish changes it executes a CCRD (Create, Copy, Rename, Delete) operation for a table. Create and Copy in the PreDeploy script and the Rename, Delete in the PostDeploy Scripts. I have these statements encapsulated in a Try...Catch block and have it printing out error messages. When the Pre and Post deploy scripts encounter issues the publish completes showing the publish as successful. I'm needing the behavior to be different when these scripts encounter errors. I would like for any errors encountered within these scripts cause the publish to fail. I've tried the THROW command to throw an error and I've tried the RAISERROR command setting severity to 20 when it's executed, which according to BOL should terminate the connection, but still the publish completes with a status of "Successful".