sayedihashimi / package-web

Extensions for ASP.NET web projects package creation
32 stars 18 forks source link

When deployment fails, automated build/deployment software doesn't pick up that info, resulting in a false-positive successful build #46

Open tbehunin opened 11 years ago

tbehunin commented 11 years ago

When using automated software to build/deploy solutions, they typically look at either the stderr stream or the return value of the script (zero or non-zero) to decipher whether the job succeeded or failed. When PackageWeb fails for whatever reason, the stderr stream isn't written to and/or the response returns zero. An easy fix for this is to call the "edit" PS command whenever an error occurs. For example:

Write-Host "Exiting with code 12345" exit 12345

tbehunin commented 11 years ago

More info to this.. Apparently when you make some PS method calls (e.g. New-Item, etc), they don't throw exceptions unless you add the "-ea stop" argument to it.

sayedihashimi commented 11 years ago

Thanks for the info here, I will look into this.