Skip to content

Commit 1b09f30

Browse files
Invoke-DbaDbDataGenerator - Stop eating the caller loop when Bogus fails to load (#10649)
M
1 parent 6931548 commit 1b09f30

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

public/Invoke-DbaDbDataGenerator.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,10 @@ function Invoke-DbaDbDataGenerator {
138138
try {
139139
$script:faker = New-Object Bogus.Faker($Locale)
140140
} catch {
141-
Stop-Function -Message "Could not load randomizer class" -Continue
141+
# No -Continue here: the begin block has no enclosing loop, so the continue would escape
142+
# the command and eat an iteration of whatever loop the caller runs in.
143+
Stop-Function -Message "Could not load randomizer class"
144+
return
142145
}
143146

144147
# This list has to match the one in Test-DbaDbDataGeneratorConfig, because a configuration is

0 commit comments

Comments
 (0)