Skip to content

Commit

Permalink
Fixing error message mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
FriedrichWeinmann committed Oct 3, 2023
1 parent ef177b5 commit 286cedb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion public/Get-DbaCmObject.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function Get-DbaCmObject {

$badConnection = $false
$badCredentials = $false
$code = $ErrorRecord.Exception.InnerException.StatusCode
$code = $ErrorRecord.Exception.InnerException.StatusCode -as [int]
$message = $messages[$code]

#region 1 = Generic runtime error
Expand Down Expand Up @@ -220,6 +220,7 @@ function Get-DbaCmObject {
Message = $message
BadConnection = $badConnection
BadCredentials = $badCredentials
Error = $ErrorRecord
}
}
#endregion Utility Functions
Expand Down

0 comments on commit 286cedb

Please sign in to comment.