Skip to content

Commit

Permalink
Added Stop-Function calls to fix #5050 (#5052)
Browse files Browse the repository at this point in the history
* Added Stop-Function calls to fix #5050

* Simplified catch block to auto pass $EnableException to Stop-Function
  • Loading branch information
spaghettidba authored and potatoqualitee committed Feb 6, 2019
1 parent ca9ab45 commit 227182e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions functions/ConvertTo-DbaDataTable.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,10 @@ function ConvertTo-DbaDataTable {

$datarow.Item($property.Name) = $newColumn.Value
} catch {
Write-Message -Level Warning -Message "Failed to add property $($property.Name) from $object" -ErrorRecord $_ -Target $object
Stop-Function -Message "Failed to add property $($property.Name) from $object" -ErrorRecord $_ -Target $object
}
} else {
Write-Message -Level Warning -Message "Failed to add property $($property.Name) from $object" -ErrorRecord $_ -Target $object
Stop-Function -Message "Failed to add property $($property.Name) from $object" -ErrorRecord $_ -Target $object
}
}
}
Expand Down

0 comments on commit 227182e

Please sign in to comment.