Convert warning task into failed task

Hi ,

In my web app nuget pkg deploy scenario, I had a variable transformation error but the deployment continued and status is set warning.

I want the deployment to failed in this scenario. how can i convert a warning task into failed task. Please advise.

Using Octopus 2.6.5

create a avariable named “OctopusTreatWarningsAsErrors” set a true in varibles in the project