diff --git a/Tasks/SqlDacpacDeploymentOnMachineGroupV0/Main.ps1 b/Tasks/SqlDacpacDeploymentOnMachineGroupV0/Main.ps1 index 7edff374e2be..eb49840d5d9b 100644 --- a/Tasks/SqlDacpacDeploymentOnMachineGroupV0/Main.ps1 +++ b/Tasks/SqlDacpacDeploymentOnMachineGroupV0/Main.ps1 @@ -7,15 +7,27 @@ function Write-Exception $exception ) - if($exception.Message) + $errorRecord = $PSItem + try { - Write-Error ($exception.Message) + if($exception.Message) + { + Write-Error ($exception.Message) + } + else + { + Write-Error ($exception) + } } - else + catch { - Write-Error ($exception) + if ($_ -ne $null) { + Write-Verbose "Write-Exception error:" + Write-Verbose $_.ToString() + } } - throw + + throw $errorRecord } function Get-SingleFile diff --git a/Tasks/SqlDacpacDeploymentOnMachineGroupV0/task.json b/Tasks/SqlDacpacDeploymentOnMachineGroupV0/task.json index c5df522f2223..9aab45d0ba3e 100644 --- a/Tasks/SqlDacpacDeploymentOnMachineGroupV0/task.json +++ b/Tasks/SqlDacpacDeploymentOnMachineGroupV0/task.json @@ -17,7 +17,7 @@ "version": { "Major": 0, "Minor": 3, - "Patch": 20 + "Patch": 21 }, "demands": [], "minimumAgentVersion": "1.102.0", diff --git a/Tasks/SqlDacpacDeploymentOnMachineGroupV0/task.loc.json b/Tasks/SqlDacpacDeploymentOnMachineGroupV0/task.loc.json index 18f2dc546c2b..6f0a774c2117 100644 --- a/Tasks/SqlDacpacDeploymentOnMachineGroupV0/task.loc.json +++ b/Tasks/SqlDacpacDeploymentOnMachineGroupV0/task.loc.json @@ -17,7 +17,7 @@ "version": { "Major": 0, "Minor": 3, - "Patch": 20 + "Patch": 21 }, "demands": [], "minimumAgentVersion": "1.102.0",