Skip to content

Commit

Permalink
add function Get-ErrorMessage to get inner exception of failed deploy… (
Browse files Browse the repository at this point in the history
#4440)

* add function Get-ErrorMessage to get inner exception of failed deployment

* add back in exception type

* remove trailing whitespace
  • Loading branch information
RichieBzzzt authored and potatoqualitee committed Nov 7, 2018
1 parent 5eff645 commit 44e0ed3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion functions/Publish-DbaDacPackage.ps1
Expand Up @@ -303,7 +303,8 @@ function Publish-DbaDacPackage {
$dacServices.ImportBacpac($bacPackage, $dbname, $options, $null)
}
} catch [Microsoft.SqlServer.Dac.DacServicesException] {
Stop-Function -Message "Deployment failed" -ErrorRecord $_ -Continue
$message = Get-ErrorMessage -Record $_
Stop-Function -Message "Deployment failed - $($message)" -ErrorRecord $_ -Continue
} finally {
Unregister-Event -SourceIdentifier "msg"
if ($options.GenerateDeploymentReport) {
Expand Down

0 comments on commit 44e0ed3

Please sign in to comment.