@@ -129,7 +129,7 @@ function Set-SqlDscDatabase
129129
130130 $PSCmdlet.ThrowTerminatingError (
131131 [System.Management.Automation.ErrorRecord ]::new(
132- ($errorMessage ),
132+ [ System.InvalidOperationException ]::new ($errorMessage ),
133133 ' SSDD0001' , # SQL Server Database - Database not found
134134 [System.Management.Automation.ErrorCategory ]::InvalidOperation,
135135 $Name
@@ -165,7 +165,7 @@ function Set-SqlDscDatabase
165165
166166 $PSCmdlet.ThrowTerminatingError (
167167 [System.Management.Automation.ErrorRecord ]::new(
168- ($errorMessage ),
168+ [ System.ArgumentException ]::new ($errorMessage ),
169169 ' SSDD0002' , # SQL Server Database - Invalid compatibility level
170170 [System.Management.Automation.ErrorCategory ]::InvalidArgument,
171171 $CompatibilityLevel
@@ -183,7 +183,7 @@ function Set-SqlDscDatabase
183183
184184 $PSCmdlet.ThrowTerminatingError (
185185 [System.Management.Automation.ErrorRecord ]::new(
186- ($errorMessage ),
186+ [ System.ArgumentException ]::new ($errorMessage ),
187187 ' SSDD0003' , # SQL Server Database - Invalid collation
188188 [System.Management.Automation.ErrorCategory ]::InvalidArgument,
189189 $Collation
@@ -248,7 +248,7 @@ function Set-SqlDscDatabase
248248
249249 $PSCmdlet.ThrowTerminatingError (
250250 [System.Management.Automation.ErrorRecord ]::new(
251- ($errorMessage ),
251+ [ System.InvalidOperationException ]::new ($errorMessage ),
252252 ' SSDD0004' , # SQL Server Database - Set failed
253253 [System.Management.Automation.ErrorCategory ]::InvalidOperation,
254254 $DatabaseObject
0 commit comments