Skip to content

Commit

Permalink
Write-Error instead throw
Browse files Browse the repository at this point in the history
Also put last throw on ELSE block
  • Loading branch information
ClaudioESSilva committed Dec 1, 2018
1 parent 4b657f5 commit d34ea61
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function Write-RsRestCatalogItem
$itemPath = "$RsFolder/$itemName"
}

Write-Verbose "Reading file content..."
Write-Verbose "Reading file $item content..."
if ($itemType -eq 'DataSource')
{
[xml] $dataSourceXml = Get-Content -Path $EntirePath
Expand Down Expand Up @@ -289,11 +289,13 @@ function Write-RsRestCatalogItem
}
catch
{
throw (New-Object System.Exception("Failed to create catalog item: $($_.Exception.Message)", $_.Exception))
Write-Error (New-Object System.Exception("Failed to create catalog item: $($_.Exception.Message)", $_.Exception))
}
}

throw (New-Object System.Exception("Failed to create catalog item: $($_.Exception.Message)", $_.Exception))
else
{
Wrote-Error (New-Object System.Exception("Failed to create catalog item: $($_.Exception.Message)", $_.Exception))
}
}
}
}
Expand Down

0 comments on commit d34ea61

Please sign in to comment.