We have a couple custom step templates and I was wondering if its possible and if so how to pass exceptions from PowerShell back into Octopus Deploy. Currently we are catching and displaying the error like this:
catch {
$message = "error generating the script"
Write-Host $_.Exception.ToString()
exit 10004
}
This works great for displaying the error in the detailed error log however we want to send this message to the development team when it fails. Should our script set this variable (Octopus.Deployment.ErrorDetail) to the exception that is thrown?
Thanks for the help!